From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15309 invoked by alias); 25 Feb 2013 23:48:27 -0000 Received: (qmail 15245 invoked by uid 48); 25 Feb 2013 23:48:07 -0000 From: "psimerda at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug network/14967] getaddrinfo(NULL) with AI_PASSIVE returns 0.0.0.0 and :: (in this order) Date: Mon, 25 Feb 2013 23:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: 2013-02/txt/msg00145.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=3D14967 --- Comment #8 from Pavel =C5=A0imerda 2013-02= -25 23:48:06 UTC --- (In reply to comment #7) > You're wrong, this is exactly fix for described problem. Just open the co= de of > getaddrinfo implementation and you'll see this. > later today I'll attach normal tested patch as I've cloned trunk git. >=20 > getaddrinfo retruns 0.0.0.0 and :: in this order because order is based on > comparing :: with ::1 and 0.0.0.0 with 127.0.0.1 If this is so, then it really looks like an ugly hack (and is not documente= d as such, at the least). Shouldn't it be better to always have the correct addresses there in the first place? I can go through the code later but actually that should be just a sorting function that should *only* compare addresses that are on the list. You should never need to rewrite them. Anyway, it is IMO wrong to return both of them even in the opposite order w= hen binding :: binds dualstack and then 0.0.0.0 fails. But nevertheless it would fix at least part of the problem. --=20 Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are on the CC list for the bug.