This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/15726] getaddrinfo() returns incorrect status
- From: "jdthood at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sun, 14 Jul 2013 09:44:07 +0000
- Subject: [Bug network/15726] getaddrinfo() returns incorrect status
- Auto-submitted: auto-generated
- References: <bug-15726-131 at http dot sourceware dot org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=15726
--- Comment #11 from Thomas Hood <jdthood at gmail dot com> ---
> > 1. No answer received: AGAIN, BADFLAGS, FAIL, FAMILY, MEMORY, SERVICE,
> > SOCKTYPE, SYSTEM
> > 2. Answer was received: 0
>
> I'm not sure I understand what you're trying to say here. do both 1's and
> 2's match? Note that if it returns 0 it should have at least 1 address
> as result.
When status 0 is received it means that an answer has been received to the
question (simplifying a bit) "What are the addresses corresponding to this
nodename + servname?"
"There is no address corresponding to the given nodename + servname" is also an
answer.
But "Sorry, we couldn't find out what addresses correspond to this nodename +
servname because we ran out of file descriptors" is not what I am calling an
answer.
Put another way, when a client receives an answer, the client has the
information that was stored in the name services; when the client receives no
answer, the client does not have the information that was stored in the name
services. The client may want to react differently to these two outcomes.
When AGAIN, BADFLAGS, FAIL, FAMILY, MEMORY, SERVICE, SOCKTYPE, SYSTEM are
returned, it means that no answer was received.
When status 0 is returned, it means that an answer was received.
Q1. Now, what does it mean when NONAME is returned? If both nodename and
servname were null then it means just that. And if nodename and servname were
not null? Is NONAME ever returned in that case, and if so, under what
circumstances?
Q2. What is returned when the answer is "There is no address corresponding to
the given nodename + servname", i.e., in the case of DNS, NXDOMAIN?
I would be inclined to come out and say that NONAME should be returned under
exactly the following circumstances
Either nodename and servname are null
or there is no address corresponding to the given nodename+servname
if it weren't for the fact that the RFC doesn't clearly say that this is what
NONAME means, and the fact that I haven't yet looked closely enough at how
other unices have interpreted the RFC.
--
You are receiving this mail because:
You are on the CC list for the bug.