This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug network/14990] New: getaddrinfo with servname=NULL returns addresses multiple times


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]