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/15339] New: getaddrinfo returns EAI_SYSTEM instead of EAI_NONAME when the network is down


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]