Blame SOURCES/glibc-rh677316-in6addr_any.patch

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