The getaddrinfo call has many interesting flags. I'm wondering what the purpose of the AI\_V4MAPPED flag is. On no system do I seem to be able to get getaddrinfo to produce ::ffff:n.n.n.n form addresses as I would expect when I set this flag. Am I expecting the wrong thing? Am I seeing bugs?

In particlar, if I ask for AF\_INET6 family addresses and specify AI\_V4MAPPED I would expect to see ::ffff:n.n.n.n addresses for hosts that only have DNS A (IPv4 address) records. And I would also generally expect that if I specified AI\_ALL that I would get both a host's DNS AAAA (IPv6 address) records and DNS A records in ::ffff:n.n.n.n form.

Again, am I expecting all the wrong things here?

I've tested this on Fedora 11 - glibc 2.10.1 and OS X 10.4.