public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug network/15339] New: getaddrinfo returns EAI_SYSTEM instead of EAI_NONAME when the network is down
@ 2013-04-04  9:33 siddhesh at redhat dot com
  2013-04-04  9:35 ` [Bug network/15339] " siddhesh at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: siddhesh at redhat dot com @ 2013-04-04  9:33 UTC (permalink / raw)
  To: glibc-bugs

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

             Bug #: 15339
           Summary: getaddrinfo returns EAI_SYSTEM instead of EAI_NONAME
                    when the network is down
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
        AssignedTo: siddhesh@redhat.com
        ReportedBy: siddhesh@redhat.com
    Classification: Unclassified


Due to the fix to bug 14719, getaddrinfo incorrectly returns EAI_SYSTEM instead
of EAI_NONAME when the network is down.

Steps to Reproduce:

$ cat t.c
#include <stdio.h>
#include <netdb.h>
int main(void) {
        struct addrinfo *ai;
        int res = getaddrinfo ("example.net", "http", 0, &ai);
        if (res)
                printf("%s: %m\n", gai_strerror(res));
        return res && res != EAI_NONAME;
}

$ gcc -Wall -O2 t.c -o t

$ sudo unshare -n ./t

Actual Result:

System error: Connection refused

Expected Result:

Name or service not known: Connection refused

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-13 18:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-04  9:33 [Bug network/15339] New: getaddrinfo returns EAI_SYSTEM instead of EAI_NONAME when the network is down siddhesh at redhat dot com
2013-04-04  9:35 ` [Bug network/15339] " siddhesh at redhat dot com
2013-05-21 16:26 ` siddhesh at redhat dot com
2013-06-16  3:57 ` siddhesh at redhat dot com
2014-02-16 19:43 ` jackie.rosen at hushmail dot com
2014-05-28 19:42 ` schwab at sourceware dot org
2014-06-13 18:30 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).