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, Oct 12, 6:09 AM
Unknown Object (File)
Sep 17 2025, 4:30 AM
Unknown Object (File)
Sep 16 2025, 1:56 AM
Unknown Object (File)
Sep 15 2025, 12:15 AM
Unknown Object (File)
Sep 10 2025, 10:33 PM
Unknown Object (File)
Sep 8 2025, 10:25 AM
Unknown Object (File)
Aug 28 2025, 2:38 PM
Unknown Object (File)
Aug 4 2025, 12:13 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.