This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/9981] getaddrinfo prefers listening on ipv4-only over ipv4+ipv6
- From: "psimerda at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 18 Dec 2012 14:30:58 +0000
- Subject: [Bug network/9981] getaddrinfo prefers listening on ipv4-only over ipv4+ipv6
- Auto-submitted: auto-generated
- References: <bug-9981-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=9981
Pavel Åimerda <psimerda at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |psimerda at redhat dot com
AssignedTo|drepper.fsp at gmail dot |unassigned at sourceware
|com |dot org
--- Comment #4 from Pavel Åimerda <psimerda at redhat dot com> 2012-12-18 14:30:58 UTC ---
Comment from a newer duplicate:
Pavel Åimerda 2012-12-16 16:08:35 UTC
On Linux, with net.ipv6.bindv6only = 0 (the default), getaddrinfo(NULL) with
AI_PASSIVE returns 0.0.0.0 and :: (in this order). AI_PASSIVE was meant to
return a list of addresses to listen on, but it is impossible to listen on
0.0.0.0 and :: at the same time, if :: implies dualstack mode.
Even the order is wrong, as listening on :: would work for both protocols,
while listening on 0.0.0.0 does not. If the order is fixed, applications could
just spit out a warning but still work correctly.
The only proper fix I can think of, is test for net.ipv6.bindv6only and return
only :: if this is 0, otherwise return both addresses (preferably IPv6 first).
Upstream bug report:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/673708
More information:
https://fedoraproject.org/wiki/Networking/NameResolution#Binding_to_the_INADDR_ANY_and.2For_in6addr_any_addresses
Cheers,
Pavel
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.