HomeFreeBSD

libc: Import OpenBSD's inet_net_{ntop,pton}

Description

libc: Import OpenBSD's inet_net_{ntop,pton}

Our versions of these functions (originally taken from BIND) simply
don't work correctly for AF_INET6. These were removed from BIND itself
quite a while ago, but OpenBSD has made several fixes in the mean time,
so import their code.

Add tests for both functions.

Approved by: re (cperciva)
PR: 289198
Reported by: Nico Sonack <nsonack@herrhotzenplotz.de>
MFC after: 1 week
Reviewed by: des
Obtained from: OpenBSD (lib/libc/net)
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52629

(cherry picked from commit 8f4a0d2f7b96099001dbc51e06114df1a0e6d291)
(cherry picked from commit ff7a10d0e1d1498724c6a1e02a70926944a71590)

Details

Provenance
ivyAuthored on Oct 18 2025, 2:18 PM
cpercivaCommitted on Oct 23 2025, 4:26 AM
Reviewer
des
Differential Revision
D52629: libc: Import OpenBSD's inet_net_{ntop,pton}
Parents
rG1998d706dfa9: Makefile: Don't allow install{world,kernel} with pkgbase
Branches
Unknown
Tags
Unknown