HomeFreeBSD

libc/getnameinfo: stop adding NI_NUMERICHOST where inappropriate

Description

libc/getnameinfo: stop adding NI_NUMERICHOST where inappropriate

Checking the first nibble of the IPv6 address to be 0 and then
excluding two well known cases (v4-mapped, loopback) leaves us with
more cases where the first nibble could be 0, e.g., the RFC 6052,
2.1 Well-Known Prefix 64:ff9b::/96.
It is not practical to track them all and it is not clear what lead
to this special casing originally, so remove them.

While here also remove the IN6_IS_ADDR_LINKLOCAL() + NI_NUMERICHOST
case as link-local address resolution does exist.

We do leave the IN6_IS_ADDR_MULTICAST() case for now as I could
not find any references to any official reverse lookups for these.

Adding comments for more case (and some historic behaviour) in order
to make it easier to follow the logic.

PR: 279618
Fixes: 6cb9418289f90
Reviewed by: hrs
Differential Revision: https://reviews.freebsd.org/D45547

(cherry picked from commit c179937b986ec3959d89bfeb8eed0a6f58a28649)

Details

Provenance
bzAuthored on Jun 10 2024, 11:34 AM
Reviewer
hrs
Differential Revision
D45547: libc/getnameinfo: stop adding NI_NUMERICHOST where inappropriate
Parents
rG76e57cf9ded8: ixgbe: fix fw_recovery_mode callout
Branches
Unknown
Tags
Unknown