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/15726] getaddrinfo() returns incorrect status


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

--- Comment #8 from Kurt Roeckx <kurt at roeckx dot be> ---
So I've been looking into the case of a negative response. It's clear to me
that it's not documented properly in the standard(s), and I can see how you can
interprete either EAI_FAIL or EAI_NONAME as the proper answer.  And I have no
problem with either as reply.

Looking at the history of it, rfc 2133 and 2553 had:
      EAI_FAIL        non-recoverable failure in name resolution
      EAI_NODATA      no address associated with nodename
      EAI_NONAME      nodename nor servname provided, or not known

Looking at old wrappers around gethostbyname, I find code like this:
    hptr = gethostbyname(host);
    if (hptr == NULL) {
        switch (h_errno) {
            case HOST_NOT_FOUND:    return(EAI_NONAME);
            case TRY_AGAIN:        return(EAI_AGAIN);
            case NO_RECOVERY:    return(EAI_FAIL);
            case NO_DATA:        return(EAI_NODATA);
            default:        return(EAI_NONAME);
        }
    }

Tht is code written by W. Richard Stevens, among other things co-author of the
rfc.

Those error codes are defined as:
       HOST_NOT_FOUND

          No such host is known.

       NO_DATA
          The  server  recognized the request and the name, but no address
          is available. Another type of request to the name server for the
          domain might return an answer.

       NO_RECOVERY

          An unexpected server failure occurred which cannot be recovered.

       TRY_AGAIN
          A  temporary  and  possibly  transient error occurred, such as a
          failure of a server to respond.

Kurt

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