Coordinate in6_pktinfo and ip6_mtuinfo for kernel and glibc

Message ID 1420589599-9094-1-git-send-email-xiyou.wangcong@gmail.com
State Committed
Headers

Commit Message

Cong Wang Jan. 7, 2015, 12:13 a.m. UTC
  Similarly to what we did for in6_addr, we need a macro
to guard in6_pktinfo and ip6_mtuinfo too.

Cc: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 inet/netinet/in.h                 | 3 ++-
 sysdeps/unix/sysv/linux/bits/in.h | 8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
  

Comments

Mike Frysinger Feb. 24, 2015, 5:46 a.m. UTC | #1
On 06 Jan 2015 16:13, Cong Wang wrote:
> Similarly to what we did for in6_addr, we need a macro
> to guard in6_pktinfo and ip6_mtuinfo too.

lgtm
-mike
  
Mike Frysinger Feb. 25, 2015, 5:13 a.m. UTC | #2
On 06 Jan 2015 16:13, Cong Wang wrote:
> Similarly to what we did for in6_addr, we need a macro
> to guard in6_pktinfo and ip6_mtuinfo too.

i've pushed this now.  please write ChangeLog entries in the future.
-mike
  
Carlos O'Donell Feb. 25, 2015, 11:58 p.m. UTC | #3
On 02/25/2015 12:13 AM, Mike Frysinger wrote:
> On 06 Jan 2015 16:13, Cong Wang wrote:
>> Similarly to what we did for in6_addr, we need a macro
>> to guard in6_pktinfo and ip6_mtuinfo too.
> 
> i've pushed this now.  please write ChangeLog entries in the future.
> -mike

Mike,

Thank you very much for pushing this. It's almost obvious at this
point given the kind of good coordination we have going with the kernel :-)

Cheers,
Carlos.
  
Cong Wang Feb. 27, 2015, 6:31 a.m. UTC | #4
On Tue, Feb 24, 2015 at 9:13 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On 06 Jan 2015 16:13, Cong Wang wrote:
>> Similarly to what we did for in6_addr, we need a macro
>> to guard in6_pktinfo and ip6_mtuinfo too.
>
> i've pushed this now.  please write ChangeLog entries in the future.

Sure, I thought some git hook will automatically write the ChangeLog.

Thanks for fixing it!
  

Patch

diff --git a/inet/netinet/in.h b/inet/netinet/in.h
index bf3c8b1..f541c58 100644
--- a/inet/netinet/in.h
+++ b/inet/netinet/in.h
@@ -530,6 +530,7 @@  extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
 #ifdef __USE_GNU
 struct cmsghdr;			/* Forward declaration.  */
 
+#ifndef __USE_KERNEL_IPV6_DEFS
 /* IPv6 packet information.  */
 struct in6_pktinfo
   {
@@ -543,7 +544,7 @@  struct ip6_mtuinfo
     struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */
     uint32_t ip6m_mtu;		   /* path MTU in host byte order */
   };
-
+#endif /* !__USE_KERNEL_IPV6_DEFS */
 
 /* Obsolete hop-by-hop and Destination Options Processing (RFC 2292).  */
 extern int inet6_option_space (int __nbytes)
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
index b80a27f..b1d2cf6 100644
--- a/sysdeps/unix/sysv/linux/bits/in.h
+++ b/sysdeps/unix/sysv/linux/bits/in.h
@@ -23,10 +23,10 @@ 
 
 /* If the application has already included linux/in6.h from a linux-based
    kernel then we will not define the IPv6 IPPROTO_* defines, in6_addr (nor the
-   defines), sockaddr_in6, or ipv6_mreq.  The ABI used by the linux-kernel and
-   glibc match exactly.  Neither the linux kernel nor glibc should break this
-   ABI without coordination.  */
-#ifdef _UAPI_LINUX_IN6_H
+   defines), sockaddr_in6, or ipv6_mreq. Same for in6_ptkinfo or ip6_mtuinfo
+   in linux/ipv6.h. The ABI used by the linux-kernel and glibc match exactly.
+   Neither the linux kernel nor glibc should break this ABI without coordination.  */
+#if defined _UAPI_LINUX_IN6_H || defined _UAPI_IPV6_H
 /* This is not quite the same API since the kernel always defines s6_addr16 and
    s6_addr32. This is not a violation of POSIX since POSIX says "at least the
    following member" and that holds true.  */