public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug network/14967] New: getaddrinfo(NULL) with AI_PASSIVE returns 0.0.0.0 and :: (in this order)
@ 2012-12-16 16:08 psimerda at redhat dot com
  2013-02-23 18:53 ` [Bug network/14967] " me at ruff dot mobi
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: psimerda at redhat dot com @ 2012-12-16 16:08 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14967

             Bug #: 14967
           Summary: getaddrinfo(NULL) with AI_PASSIVE returns 0.0.0.0 and
                    :: (in this order)
           Product: glibc
           Version: 2.15
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
        AssignedTo: unassigned@sourceware.org
        ReportedBy: psimerda@redhat.com
    Classification: Unclassified


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.


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-06-14  5:33 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-16 16:08 [Bug network/14967] New: getaddrinfo(NULL) with AI_PASSIVE returns 0.0.0.0 and :: (in this order) psimerda at redhat dot com
2013-02-23 18:53 ` [Bug network/14967] " me at ruff dot mobi
2013-02-23 19:11 ` me at ruff dot mobi
2013-02-24 22:15 ` psimerda at redhat dot com
2013-02-24 23:16 ` me at ruff dot mobi
2013-02-24 23:21 ` me at ruff dot mobi
2013-02-25  8:13 ` psimerda at redhat dot com
2013-02-25 18:58 ` me at ruff dot mobi
2013-02-25 23:48 ` psimerda at redhat dot com
2013-02-26  7:40 ` me at ruff dot mobi
2013-02-26  8:28 ` psimerda at redhat dot com
2013-02-26 20:09 ` me at ruff dot mobi
2013-02-26 20:24 ` me at ruff dot mobi
2013-02-26 20:47 ` me at ruff dot mobi
2013-02-26 21:36 ` psimerda at redhat dot com
2013-02-26 21:42 ` me at ruff dot mobi
2013-03-03 23:46 ` me at ruff dot mobi
2014-02-16 17:51 ` jackie.rosen at hushmail dot com
2014-04-10  0:41 ` pub at craig dot mcqueen.id.au
2014-04-10  6:55 ` psimerda at redhat dot com
2014-05-28 19:45 ` schwab at sourceware dot org
2014-06-14  5:33 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).