Bug 14966 - getaddrinfo() with AI_ADDRCONFIG may fail to properly resolve /etc/hosts names, e.g. "localhost"
Summary: getaddrinfo() with AI_ADDRCONFIG may fail to properly resolve /etc/hosts name...
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: network (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-16 15:51 UTC by Pavel Šimerda
Modified: 2019-01-28 15:45 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
...