[Bug network/9981] getaddrinfo(NULL) with AI_PASSIVE returns 0.0.0.0 (IPv4-only) and :: (IPv6+IPv4) in this order
bugzilla.sourceware.simon at arlott dot org
sourceware-bugzilla@sourceware.org
Sun Jun 1 09:35:00 GMT 2014
https://sourceware.org/bugzilla/show_bug.cgi?id=9981
--- Comment #13 from Simon Arlott <bugzilla.sourceware.simon at arlott dot org> ---
(In reply to Pavel Šimerda from comment #12)
> Then I would say we should assume bindv6only won't change between the call
> to getaddrinfo() and bind(). I know it's not 100% perfect but most systems
> don't change the setting at runtime at all. It certainly better than the
> current situation.
You're making an assumption that the application hasn't been developed to work
around this already. The default is usually bindv6only=0 in the sysctl but I've
written code that sets the IPV6_V6ONLY=1 socket flag specifically so that all
of the getaddrinfo() addresses will bind successfully.
I'd suggest documenting this non-AF-independent behaviour in the man page or
pushing for an AF-independent "I'm using getaddrinfo() so don't try to second
guess what I mean by bind()" socket flag.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list