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] getaddrinfo with servname=NULL returns duplicate addresses


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

--- Comment #6 from Ruslan N. Marchenko <me at ruff dot mobi> 2013-03-07 19:29:01 UTC ---
> Please look at it from the perspective of both the POSIX standard and the fact
> that getaddrinfo() was designed to replace both gethostbyname().

This is the only point I'm looking at it from

>> Hence getaddrinfo(something,null,whatever) should always return RAW.
>Incorrect, in my opinion.

>> Similarly asking for RAW should ignore service since there's no service
>> for raw socket.
> Above you asked hints to be always ignored when service is NULL.
Yes, this is not explicitly written by standard so my common sense is saying
that it's useless to parse socktype when service s null. although one can
always return error for unclear by standard cases.

> Using AI_PASSIVE with non-null host makes perfect sense even 
> though AI_PASSIVE is ignored then.

I think we need to be careful with common sense when dealing with explicitly
stated standard:
http://pubs.opengroup.org/onlinepubs/009695399/functions/getaddrinfo.html
>> qoute >>
The AI_PASSIVE flag shall be ignored if the nodename argument is not null.
<< end quote <<

> You and many others are forgetting that the flags and the values usually don't come from the same source.

I don't, and that the background for my reasoning.

>The Python function is a convenience wrapper over the C call, there's no need
to compare them.

right, my c snippet initially was returning different result so i started this
C part but then i found i was setting socktype at the end. You can disregard
it.

> The patch is already available as part of my patchset:
Glad you care about that. And since getaddrinfo is to be completely revamped
anyway I'm going to propose another solution for passive flag.

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