This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/15339] New: getaddrinfo returns EAI_SYSTEM instead of EAI_NONAME when the network is down
- From: "siddhesh at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 04 Apr 2013 09:33:10 +0000
- Subject: [Bug network/15339] New: getaddrinfo returns EAI_SYSTEM instead of EAI_NONAME when the network is down
- Auto-submitted: auto-generated
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.