diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2014-09-27 07:13:20 -0300 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2014-11-07 07:18:53 -0200 |
commit | 393207b6a74aeed6227d88174b8b37e4ee095260 (patch) | |
tree | aaaa1035a68225f2d1914aebecef71ae3904888d | |
parent | 2e8a3341f470d8fa0dce69b8cf83e346a0017ada (diff) | |
download | glibc-393207b6a74aeed6227d88174b8b37e4ee095260.zip glibc-393207b6a74aeed6227d88174b8b37e4ee095260.tar.gz glibc-393207b6a74aeed6227d88174b8b37e4ee095260.tar.bz2 |
drop v4-to-v6 conversions of loopback addresses from /etc/hosts
for ChangeLog
* nss/nss_files/files-hosts.c (LINE_PARSER): Drop family
conversion of loopback addresses from IPv4 to IPv6.
-rw-r--r-- | nss/nss_files/files-hosts.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c index 49656bc..639345a 100644 --- a/nss/nss_files/files-hosts.c +++ b/nss/nss_files/files-hosts.c @@ -43,6 +43,9 @@ struct hostent_data char *h_addr_ptrs[2]; /* Points to that and null terminator. */ }; +#define IN_IS_ADDR_LOOPBACK(addr) \ + (((const char *)(addr))[0] == IN_LOOPBACKNET) + #define TRAILING_LIST_MEMBER h_aliases #define TRAILING_LIST_SEPARATOR_P isspace #include "files-parse.c" @@ -60,7 +63,8 @@ LINE_PARSER else { if (af == AF_INET6 && (flags & AI_V4MAPPED) != 0 - && inet_pton (AF_INET, addr, entdata->host_addr) > 0) + && inet_pton (AF_INET, addr, entdata->host_addr) > 0 + && !IN_IS_ADDR_LOOPBACK (entdata->host_addr)) map_v4v6_address ((char *) entdata->host_addr, (char *) entdata->host_addr); else if (af == AF_INET |