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/14967] getaddrinfo(NULL) with AI_PASSIVE returns 0.0.0.0 and :: (in this order)


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

--- Comment #8 from Pavel Åimerda <psimerda at redhat dot com> 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 code of
> getaddrinfo implementation and you'll see this.
> later today I'll attach normal tested patch as I've cloned trunk git.
> 
> 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 documented 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 when
binding :: binds dualstack and then 0.0.0.0 fails. But nevertheless it would
fix at least part of the problem.

-- 
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]