olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone
00db10
commit c9bd40daaee18cf1d9824e4a7ebaebe321e0a5a8
00db10
Author: Carlos O'Donell <carlos@redhat.com>
00db10
Date:   Tue Jun 7 04:46:37 2016 -0400
00db10
00db10
    Bug 20214: Fix linux/in6.h and netinet/in.h sync.
00db10
    
00db10
    In: https://sourceware.org/glibc/wiki/Synchronizing_Headers
00db10
    we explain how we synchronize our headers with Linux kernel
00db10
    headers.
00db10
    
00db10
    In order to synchronize with the Linux linux/in6.h and
00db10
    linux/ipv6.h headers we checked for their guard macros and
00db10
    then defined __USE_KERNEL_IPV6_DEFS and conditionalized code
00db10
    on this macro.
00db10
    
00db10
    In upstream kernel 56c176c9 the _UAPI prefix was stripped and
00db10
    this broke our synchronized headers again. We now need to check
00db10
    for _LINUX_IN6_H and _IPV6_H, and keep checking the old versions
00db10
    of the header guard checks for maximum backwards compatibility
00db10
    with older Linux headers (the history is actually a bit muddled
00db10
    here and it appears upstream linus kernel broke this 10 months
00db10
    *before* our fix was ever applied to glibc, but without glibc
00db10
    testing we didn't notice and distro kernels have their own
00db10
    testing to fix this).
00db10
    
00db10
    This patch fixes synchronization with linux/in6.h and
00db10
    with netinet/in.h.
00db10
00db10
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
00db10
index 9bdadf3..4d70a6b 100644
00db10
--- a/sysdeps/unix/sysv/linux/bits/in.h
00db10
+++ b/sysdeps/unix/sysv/linux/bits/in.h
00db10
@@ -25,8 +25,14 @@
00db10
    kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the
00db10
    defines), sockaddr_in6, or ipv6_mreq. Same for in6_ptkinfo or ip6_mtuinfo
00db10
    in linux/ipv6.h. The ABI used by the linux-kernel and glibc match exactly.
00db10
-   Neither the linux kernel nor glibc should break this ABI without coordination.  */
00db10
-#if defined _UAPI_LINUX_IN6_H || defined _UAPI_IPV6_H
00db10
+   Neither the linux kernel nor glibc should break this ABI without coordination.
00db10
+   In upstream kernel 56c176c9 the _UAPI prefix was stripped so we need to check
00db10
+   for _LINUX_IN6_H and _IPV6_H now, and keep checking the old versions for
00db10
+   maximum backwards compatibility.  */
00db10
+#if defined _UAPI_LINUX_IN6_H \
00db10
+    || defined _UAPI_IPV6_H \
00db10
+    || defined _LINUX_IN6_H \
00db10
+    || defined _IPV6_H
00db10
 /* This is not quite the same API since the kernel always defines s6_addr16 and
00db10
    s6_addr32. This is not a violation of POSIX since POSIX says "at least the
00db10
    following member" and that holds true.  */
00db10
@@ -209,8 +215,10 @@ struct in_pktinfo
00db10
 #define IPV6_TCLASS		67
00db10
 
00db10
 /* Obsolete synonyms for the above.  */
00db10
-#define IPV6_ADD_MEMBERSHIP	IPV6_JOIN_GROUP
00db10
-#define IPV6_DROP_MEMBERSHIP	IPV6_LEAVE_GROUP
00db10
+#if !__USE_KERNEL_IPV6_DEFS
00db10
+# define IPV6_ADD_MEMBERSHIP	IPV6_JOIN_GROUP
00db10
+# define IPV6_DROP_MEMBERSHIP	IPV6_LEAVE_GROUP
00db10
+#endif
00db10
 #define IPV6_RXHOPOPTS		IPV6_HOPOPTS
00db10
 #define IPV6_RXDSTOPTS		IPV6_DSTOPTS
00db10