[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



In article <56089AAC80E082438E7D3F0228DA368B0590682B@xxxxxxxxxxxxxxxxxxxx> (at Fri, 22 Jul 2005 15:29:02 -0400), "mclellan, dave" <mclellan_dave@xxxxxxx> 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