getaddrinfo() spec doesn't match behaviour

Hajimu UMEMOTO ume at freebsd.org
Sun Feb 3 11:14:14 PST 2008


Hi,

>>>>> On Sun, 3 Feb 2008 14:50:18 +0100
>>>>> "Heiko Wundram (Beenic)" <wundram at beenic.net> said:

wundram> hints.ai_flags is logically anded with AI_MASK at the beginning of the 
wundram> function, and AI_MASK (at least in my local netdb.h header) does not contain 
wundram> the flag AI_V4MAPPED. In case the result of that is non-zero (which it is due 
wundram> to me specifying AI_V4MAPPED), the function returns EAI_BADFLAGS.

wundram> After that, getaddrinfo() does some checks on AI_V4MAPPED and AI_ALL (masking 
wundram> the respective flags in case the ai_family isn't AF_INET6), which are 
wundram> basically superfluous (as they can never be set anyway due to AI_MASK), but I 
wundram> didn't find any other reference to the flag in the whole of 
wundram> lib/libc/net/getaddrinfo.c, so I actually don't know whether the cause of 
wundram> this failing is that it simply isn't implemented (completely), or there's any 
wundram> other reason for AI_MASK not to contain these flags that I haven't grasped so 
wundram> far.

Since the part is incomplete support of AI_ALL and AI_V4MAPPED, I've
just nuked it.

http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/net/getaddrinfo.c#rev1.87

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume at mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/


More information about the freebsd-hackers mailing list