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