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


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

--- Comment #32 from Thomas Hood <jdthood at gmail dot com> ---
>From the point of view of the user of getaddrinfo() it is mainly going to be
important to distinguish the following three outcomes of the getaddrinfo()
call.

    A. Success => Go ahead and use the returned address
    B. Temporary failure => Retry
    C. Permanent failure => Abort

Although there is ambiguity in the specs, variability in the implementations
and lack of consensus in this discussion, am I right in saying that it is
correct to program the application as follows?

    0 => Success => Go ahead and use the returned address
    EAI_AGAIN => Temporary failure => Retry
    EAI_FAIL | EAI_NONAME => Permanent failure => Abort

With reference to the last line: EAI_FAIL is explicitly specified to indicate a
permanent failure. The "bad parameters" cause of EAI_NONAME is also a permanent
failure. And whether it should result in EAI_FAIL or EAI_NONAME or EAI_NODATA,
the absence of the hostname from the name service or absence of addresses for
that hostname in the name service is also a permanent condition which can be
regarded as a permanent failure to obtain an address for that name.

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