Bug 14966

Summary: getaddrinfo() with AI_ADDRCONFIG may fail to properly resolve /etc/hosts names, e.g. "localhost"
Product: glibc Reporter: Pavel Šimerda <psimerda>
Component: networkAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: normal CC: fweimer
Priority: P2 Flags: fweimer: security-
Version: 2.15   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Pavel Šimerda 2012-12-16 15:51:36 UTC
From upstream bug reports:

https://bugzilla.redhat.com/show_bug.cgi?id=887577
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/583278

--

Pavel Simerda 2012-12-16 09:25:03 EST

AI_ADDRCONFIG may cause getaddrinfo() to filter out IPv4 or IPv6 addresses, depending on the network configuration. Detailed info here:

https://fedoraproject.org/wiki/Networking/NameResolution/ADDRCONFIG

Related Fedora bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=721350

--

Related upstream bug report:

http://sourceware.org/bugzilla/show_bug.cgi?id=12398
Comment 1 Pavel Šimerda 2012-12-16 15:56:05 UTC
> AI_ADDRCONFIG may cause getaddrinfo() to filter out IPv4 or IPv6 addresses,
> depending on the network configuration. Detailed info here:

Of course I meant addresses from /etc/hosts.
Comment 2 Pavel Šimerda 2013-01-22 17:39:50 UTC
In many cases, having localhost point to both IPv4 and IPv6 addesses can serve as a workaround:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
...