(usagi-users 03452) Re: getaddrinfo() returns sockaddr_in6 but machine doesn't have IPv6 turned on

YOSHIFUJI Hideaki / 吉藤英明 <[email protected]>
Newsgroups gmane.linux.ipv6.usagi.users,gmane.network.ipv6.general
Organization USAGI/WIDE Project
Message-ID <[email protected]>
In article <[email protected]> (at Fri, 22 Jul 2005 15:29:02 -0400), "mclellan, dave" <[email protected]> says:

> But why does getaddrinfo() give me and sockaddr_in6 back?  IPv6 is not
> turned on for the machine;  shouldn't getaddrinfo() only give me a
> sockaddr_in?  

Specification says nothing about it, and it is debatable.
Traditionally, many getaddrinfo() implementations return
all addresses associated with the hostname, even
if the node does not support IPv6.

AI_ADDRCONF may help you in some cases.

Some people says it is okay and it is even better not to return
IPv6 addresses if it is unavailable (e.g. without global addresses)
on the node.

--yoshfuji
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.