-- RFC 3493 states: If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be returned only if an IPv4 address is configured on the local system, and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system. The loopback address is not considered for this case as valid as a configured address. For example, when using the DNS, a query for AAAA records should occur only if the node has at least one IPv6 address configured (other than IPv6 loopback) and a query for A records should occur only if the node has at least one IPv4 address configured (other than the IPv4 loopback). -- end The problem is that the getaddrinfo and __check_pf (seen_ipv4 or seen_ipv6) functions don't take into account the fact that the loopback addresses must be ignored when AI_ADDRCONFIG is set. For example, a call to getaddrinfo, link this one: getaddrinfo("::1", NULL, {.family=AF_INET6, .hints=0|AI_ADDRCONFIG}) must fail on machines with no public ipv6 addresses.
I checked in changes to the CVS mainline.