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)
Fri, Nov 21, 5:25 AM
Unknown Object (File)
Fri, Nov 21, 5:20 AM
Unknown Object (File)
Fri, Nov 21, 5:17 AM
Unknown Object (File)
Fri, Nov 21, 5:13 AM
Unknown Object (File)
Sun, Nov 16, 11:10 AM
Unknown Object (File)
Nov 9 2025, 11:31 PM
Unknown Object (File)
Nov 8 2025, 7:41 AM
Unknown Object (File)
Nov 8 2025, 4:35 AM

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #25248)

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.