public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug network/14990] New: getaddrinfo with servname=NULL returns addresses multiple times
@ 2012-12-30 12:54 psimerda at redhat dot com
  2013-01-11 14:50 ` [Bug network/14990] getaddrinfo with servname=NULL returns duplicate addresses psimerda at redhat dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: psimerda at redhat dot com @ 2012-12-30 12:54 UTC (permalink / raw)
  To: glibc-bugs

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

             Bug #: 14990
           Summary: getaddrinfo with servname=NULL returns addresses
                    multiple times
           Product: glibc
           Version: 2.15
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
        AssignedTo: unassigned@sourceware.org
        ReportedBy: psimerda@redhat.com
    Classification: Unclassified


Testing in python:

>>> print(*getaddrinfo ("localhost", None), sep='\n')

Actual result:

(10, 1, 6, '', ('::1', 0, 0, 0))
(10, 2, 17, '', ('::1', 0, 0, 0))
(10, 3, 0, '', ('::1', 0, 0, 0))
(2, 1, 6, '', ('127.0.0.1', 0))
(2, 2, 17, '', ('127.0.0.1', 0))
(2, 3, 0, '', ('127.0.0.1', 0))

Expected result:

(10, 0, 0, '', ('::1', 0, 0, 0))
(2, 0, 0, '', ('127.0.0.1', 0))

POSIX1-2008:

If servname is null, the call shall return network-level addresses for the
specified nodename.

http://pubs.opengroup.org/onlinepubs/009604499/functions/getaddrinfo.html

Filling in the socktype and protocol is IMO not a good idea and returning
duplicate addresses prevents applications from using getaddrinfo for host name
resolution and violates POSIX.

-- 
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] 11+ messages in thread

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

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-30 12:54 [Bug network/14990] New: getaddrinfo with servname=NULL returns addresses multiple times psimerda at redhat dot com
2013-01-11 14:50 ` [Bug network/14990] getaddrinfo with servname=NULL returns duplicate addresses psimerda at redhat dot com
2013-01-11 15:29 ` psimerda at redhat dot com
2013-01-11 15:58 ` psimerda at redhat dot com
2013-01-11 16:11 ` psimerda at redhat dot com
2013-02-24 22:12 ` psimerda at redhat dot com
2013-03-07  7:28 ` me at ruff dot mobi
2013-03-07 12:01 ` psimerda at redhat dot com
2013-03-07 19:29 ` me at ruff dot mobi
2013-03-07 19:55 ` me at ruff dot mobi
2014-06-14  5:24 ` 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).