2011-07-25 10:53:48 +02:00
|
|
|
This fixes the problem of getent ahosts localhost returning 127.0.0.1
|
|
|
|
_twice_ on systems that have no ipv6 interfaces up (hence are regarded
|
|
|
|
as ipv4 only by the lookup code), but still have localhost entries for
|
|
|
|
::1 and 127.0.0.1 in /etc/hosts (like most current systems).
|
|
|
|
|
|
|
|
Remapping ::1 to 127.0.0.1 is bogus when /etc/hosts is correct.
|
|
|
|
bnc #684534, #606980
|
|
|
|
http://sources.redhat.com/bugzilla/show_bug.cgi?id=4980
|
|
|
|
|
2013-08-06 16:52:55 +02:00
|
|
|
Index: glibc-2.17.90/nss/nss_files/files-hosts.c
|
2011-07-25 10:53:48 +02:00
|
|
|
===================================================================
|
2013-08-06 16:52:55 +02:00
|
|
|
--- glibc-2.17.90.orig/nss/nss_files/files-hosts.c
|
|
|
|
+++ glibc-2.17.90/nss/nss_files/files-hosts.c
|
2012-08-28 14:25:24 +02:00
|
|
|
@@ -68,11 +68,6 @@ LINE_PARSER
|
2011-07-25 10:53:48 +02:00
|
|
|
{
|
|
|
|
if (IN6_IS_ADDR_V4MAPPED (entdata->host_addr))
|
|
|
|
memcpy (entdata->host_addr, entdata->host_addr + 12, INADDRSZ);
|
|
|
|
- else if (IN6_IS_ADDR_LOOPBACK (entdata->host_addr))
|
|
|
|
- {
|
|
|
|
- in_addr_t localhost = htonl (INADDR_LOOPBACK);
|
|
|
|
- memcpy (entdata->host_addr, &localhost, sizeof (localhost));
|
|
|
|
- }
|
|
|
|
else
|
|
|
|
/* Illegal address: ignore line. */
|
|
|
|
return 0;
|