Has anyone tried to use getaddrinfo with the AI_V4MAPPED flag (perhaps even OR'd with AI_ALL) and the family set to AF_INET6? From what I gleaned from a brief look at httpd, the consumer in question, it appears as though IPv4-mapped addressing is used in general.
I haven't tried AI_V4MAPPED in APR personally. We want APR to return just an IPv4 address (sockaddr_in, not sockaddr_in6) if the host has no IPv6 mapping.
IPv4-mapped addresses have been necessarily used by httpd when there is a single IPv6 listening socket for a given port because the kernel has to pass it a mapped address when there is an IPv4 connection to that IPv6 listening socket.
But whether or not there is a single IPv6 listening socket for a given port which can handle IPv4+IPv6 depends upon which Apache release and your set of Listen directives and your platform.
Looking through the CVS code for network_io/unix/sockaddr.c (1.43.2.4) from March 6th, it seems as though getaddrinfo is one of the few areas that wasn't properly upgraded to use v4 mapped addresses. While the standard IPv4 API should work, HP-UX seems to prefer IPv6 everywhere (map v4's when needed).
Can you tell me how to reproduce this issue on 11.23, so I may verify this?
The issue I thought we were discussing is an HP-UX misinstallation resulting in a getaddrinfo() that can only resolve hosts listed in /etc/hosts. I don't think you want to try to reproduce this ;)
