History

ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo

Both netinet/in.h and linux/ipv6.h define these two structs, if we include both of them, we got: /usr/include/linux/ipv6.h:19:8: error: redefinition of ‘struct in6_pktinfo’ struct in6_pktinfo { ^ In file included from /usr/include/arpa/inet.h:22:0, from txtimestamp.c:33: /usr/include/netinet/in.h:524:8: note: originally defined here struct in6_pktinfo ^ In file included from txtimestamp.c:40:0: /usr/include/linux/ipv6.h:24:8: error: redefinition of ‘struct ip6_mtuinfo’ struct ip6_mtuinfo { ^ In file included from /usr/include/arpa/inet.h:22:0, from txtimestamp.c:33: /usr/include/netinet/in.h:531:8: note: originally defined here struct ip6_mtuinfo ^ So similarly to what we did for in6_addr, we need to sync with libc header on their definitions.

WANG Cong committed 11 years ago

Commit 3b50d901 parent 44d84d72 files · +10 −1Browse files

Showing the changes to include/uapi/linux (2 of 2 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/ipv6.h +4 −1
  2. include/uapi/linux/libc-compat.h +6 −0
include/uapi/linux/ipv6.h+4−1
@@ -15,16 +15,19 @@ · 14 unmodified lines
1515 * *under construction*
1616 */
1717
18−
18+#if __UAPI_DEF_IN6_PKTINFO
1919 struct in6_pktinfo {
2020 struct in6_addr ipi6_addr;
2121 int ipi6_ifindex;
2222 };
23+#endif
2324
25+#if __UAPI_DEF_IP6_MTUINFO
2426 struct ip6_mtuinfo {
2527 struct sockaddr_in6 ip6m_addr;
2628 __u32 ip6m_mtu;
2729 };
30+#endif
2831
2932 struct in6_ifreq {
3033 struct in6_addr ifr6_addr;
include/uapi/linux/libc-compat.h+6−0
@@ -70,6 +70,8 @@ · 69 unmodified lines
7070 #define __UAPI_DEF_IPV6_MREQ 0
7171 #define __UAPI_DEF_IPPROTO_V6 0
7272 #define __UAPI_DEF_IPV6_OPTIONS 0
73+#define __UAPI_DEF_IN6_PKTINFO 0
74+#define __UAPI_DEF_IP6_MTUINFO 0
7375
7476 #else
7577
@@ -84,6 +86,8 @@ · 8 unmodified lines
8486 #define __UAPI_DEF_IPV6_MREQ 1
8587 #define __UAPI_DEF_IPPROTO_V6 1
8688 #define __UAPI_DEF_IPV6_OPTIONS 1
89+#define __UAPI_DEF_IN6_PKTINFO 1
90+#define __UAPI_DEF_IP6_MTUINFO 1
8791
8892 #endif /* _NETINET_IN_H */
8993
@@ -106,6 +110,8 @@ · 16 unmodified lines
106110 #define __UAPI_DEF_IPV6_MREQ 1
107111 #define __UAPI_DEF_IPPROTO_V6 1
108112 #define __UAPI_DEF_IPV6_OPTIONS 1
113+#define __UAPI_DEF_IN6_PKTINFO 1
114+#define __UAPI_DEF_IP6_MTUINFO 1
109115
110116 /* Definitions for xattr.h */
111117 #define __UAPI_DEF_XATTR 1