olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh677316-in6addr_any.patch

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