public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "psimerda at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug network/14990] New: getaddrinfo with servname=NULL returns addresses multiple times
Date: Sun, 30 Dec 2012 12:54:00 -0000	[thread overview]
Message-ID: <bug-14990-131@http.sourceware.org/bugzilla/> (raw)

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.


             reply	other threads:[~2012-12-30 12:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-30 12:54 psimerda at redhat dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-14990-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).