From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28664 invoked by alias); 30 Dec 2012 12:54:16 -0000 Received: (qmail 28571 invoked by uid 48); 30 Dec 2012 12:53:41 -0000 From: "psimerda at redhat dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: network X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: psimerda at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00301.txt.bz2 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.