Page MenuHomeFreeBSD

Remove inet_ntoa(); use inet_ntoa_r() instead
ClosedPublic

Authored by vangyzen on Feb 15 2017, 10:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 9, 6:32 PM
Unknown Object (File)
Fri, Mar 7, 7:34 PM
Unknown Object (File)
Wed, Mar 5, 8:01 PM
Unknown Object (File)
Thu, Feb 27, 2:34 PM
Unknown Object (File)
Sat, Feb 22, 8:28 AM
Unknown Object (File)
Jan 21 2025, 2:17 PM
Unknown Object (File)
Jan 20 2025, 9:14 AM
Unknown Object (File)
Jan 13 2025, 9:47 PM

Details

Summary

inet_ntoa() cannot be used safely in a multithreaded environment
because it uses a static local buffer. Instead, use inet_ntoa_r()
with a buffer on the caller's stack.

Remove inet_ntoa() from head (no MFC).

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7496
Build 7657: arc lint + arc unit

Event Timeline

vangyzen retitled this revision from to Remove inet_ntoa(); use inet_ntoa_r() instead.
vangyzen updated this object.
vangyzen edited the test plan for this revision. (Show Details)
vangyzen added subscribers: network, glebius, emaste.
sys/netpfil/pf/pf_osfp.c
123

Note: This INET6 conditional existed before my changes, but opt_inet6.h was not included, so INET6 was never defined. Apparently, pf's OS fingerprinting hasn't worked with IPv6 for a decade.

gnn added a reviewer: gnn.
This revision is now accepted and ready to land.Feb 15 2017, 11:49 PM
kp added a reviewer: kp.
kp added a subscriber: kp.

pf bits look good to me.

This revision was automatically updated to reflect the committed changes.