|
|
51f0aa |
Partial backport of:
|
|
|
51f0aa |
|
|
|
51f0aa |
commit 17c199ee92e4ca8a34a47c42924608a25a444eb2
|
|
|
51f0aa |
Author: Joseph Myers <joseph@codesourcery.com>
|
|
|
51f0aa |
Date: Wed Jun 17 20:08:22 2015 +0000
|
|
|
51f0aa |
|
|
|
51f0aa |
Fix gethostbyaddr in6addr_any, in6addr_loopback namespace (bug 18532).
|
|
|
51f0aa |
|
|
|
51f0aa |
The conform/Makefile changes have been omitted because glibc 2.17 did
|
|
|
51f0aa |
not have linknamespace tests.
|
|
|
51f0aa |
|
|
|
51f0aa |
diff --git a/include/netinet/in.h b/include/netinet/in.h
|
|
|
51f0aa |
index 6fb5c86de999ba82..5e377469e782a5b1 100644
|
|
|
51f0aa |
--- a/include/netinet/in.h
|
|
|
51f0aa |
+++ b/include/netinet/in.h
|
|
|
51f0aa |
@@ -5,7 +5,11 @@
|
|
|
51f0aa |
#ifndef _ISOMAC
|
|
|
51f0aa |
libc_hidden_proto (bindresvport)
|
|
|
51f0aa |
libc_hidden_proto (in6addr_loopback)
|
|
|
51f0aa |
+extern __typeof (in6addr_loopback) __in6addr_loopback;
|
|
|
51f0aa |
+libc_hidden_proto (__in6addr_loopback)
|
|
|
51f0aa |
libc_hidden_proto (in6addr_any)
|
|
|
51f0aa |
+extern __typeof (in6addr_any) __in6addr_any;
|
|
|
51f0aa |
+libc_hidden_proto (__in6addr_any)
|
|
|
51f0aa |
#endif
|
|
|
51f0aa |
|
|
|
51f0aa |
#endif
|
|
|
51f0aa |
diff --git a/inet/gethstbyad_r.c b/inet/gethstbyad_r.c
|
|
|
51f0aa |
index d8e4988a312a0799..5ae854b4f91e72ad 100644
|
|
|
51f0aa |
--- a/inet/gethstbyad_r.c
|
|
|
51f0aa |
+++ b/inet/gethstbyad_r.c
|
|
|
51f0aa |
@@ -32,7 +32,7 @@
|
|
|
51f0aa |
be performed. */
|
|
|
51f0aa |
#define PREPROCESS \
|
|
|
51f0aa |
if (len == sizeof (struct in6_addr) \
|
|
|
51f0aa |
- && __builtin_expect (memcmp (&in6addr_any, addr, \
|
|
|
51f0aa |
+ && __builtin_expect (memcmp (&__in6addr_any, addr, \
|
|
|
51f0aa |
sizeof (struct in6_addr)), 1) == 0) \
|
|
|
51f0aa |
{ \
|
|
|
51f0aa |
*h_errnop = HOST_NOT_FOUND; \
|
|
|
51f0aa |
diff --git a/inet/in6_addr.c b/inet/in6_addr.c
|
|
|
51f0aa |
index 558b375e46dc62dc..03fbb85803e3d0b7 100644
|
|
|
51f0aa |
--- a/inet/in6_addr.c
|
|
|
51f0aa |
+++ b/inet/in6_addr.c
|
|
|
51f0aa |
@@ -18,9 +18,13 @@
|
|
|
51f0aa |
|
|
|
51f0aa |
#include <netinet/in.h>
|
|
|
51f0aa |
|
|
|
51f0aa |
-const struct in6_addr in6addr_any =
|
|
|
51f0aa |
+const struct in6_addr __in6addr_any =
|
|
|
51f0aa |
{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
|
|
|
51f0aa |
-libc_hidden_data_def (in6addr_any)
|
|
|
51f0aa |
-const struct in6_addr in6addr_loopback =
|
|
|
51f0aa |
+libc_hidden_data_def (__in6addr_any)
|
|
|
51f0aa |
+weak_alias (__in6addr_any, in6addr_any)
|
|
|
51f0aa |
+libc_hidden_data_weak (in6addr_any)
|
|
|
51f0aa |
+const struct in6_addr __in6addr_loopback =
|
|
|
51f0aa |
{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
|
|
|
51f0aa |
-libc_hidden_data_def (in6addr_loopback)
|
|
|
51f0aa |
+libc_hidden_data_def (__in6addr_loopback)
|
|
|
51f0aa |
+weak_alias (__in6addr_loopback, in6addr_loopback)
|
|
|
51f0aa |
+libc_hidden_data_weak (in6addr_loopback)
|