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
15 * *under construction*15 * *under construction*
16 */16 */
17 17
18 18#if __UAPI_DEF_IN6_PKTINFO
19struct in6_pktinfo {19struct in6_pktinfo {
20 struct in6_addr ipi6_addr;20 struct in6_addr ipi6_addr;
21 int ipi6_ifindex;21 int ipi6_ifindex;
22};22};
23#endif
23 24
25#if __UAPI_DEF_IP6_MTUINFO
24struct ip6_mtuinfo {26struct ip6_mtuinfo {
25 struct sockaddr_in6 ip6m_addr;27 struct sockaddr_in6 ip6m_addr;
26 __u32 ip6m_mtu;28 __u32 ip6m_mtu;
27};29};
30#endif
28 31
29struct in6_ifreq {32struct in6_ifreq {
30 struct in6_addr ifr6_addr;33 struct in6_addr ifr6_addr;
include/uapi/linux/libc-compat.h+6−0
@@ -70,6 +70,8 @@ · 69 unmodified lines
70#define __UAPI_DEF_IPV6_MREQ 070#define __UAPI_DEF_IPV6_MREQ 0
71#define __UAPI_DEF_IPPROTO_V6 071#define __UAPI_DEF_IPPROTO_V6 0
72#define __UAPI_DEF_IPV6_OPTIONS 072#define __UAPI_DEF_IPV6_OPTIONS 0
73#define __UAPI_DEF_IN6_PKTINFO 0
74#define __UAPI_DEF_IP6_MTUINFO 0
73 75
74#else76#else
75 77
@@ -84,6 +86,8 @@ · 8 unmodified lines
84#define __UAPI_DEF_IPV6_MREQ 186#define __UAPI_DEF_IPV6_MREQ 1
85#define __UAPI_DEF_IPPROTO_V6 187#define __UAPI_DEF_IPPROTO_V6 1
86#define __UAPI_DEF_IPV6_OPTIONS 188#define __UAPI_DEF_IPV6_OPTIONS 1
89#define __UAPI_DEF_IN6_PKTINFO 1
90#define __UAPI_DEF_IP6_MTUINFO 1
87 91
88#endif /* _NETINET_IN_H */92#endif /* _NETINET_IN_H */
89 93
@@ -106,6 +110,8 @@ · 16 unmodified lines
106#define __UAPI_DEF_IPV6_MREQ 1110#define __UAPI_DEF_IPV6_MREQ 1
107#define __UAPI_DEF_IPPROTO_V6 1111#define __UAPI_DEF_IPPROTO_V6 1
108#define __UAPI_DEF_IPV6_OPTIONS 1112#define __UAPI_DEF_IPV6_OPTIONS 1
113#define __UAPI_DEF_IN6_PKTINFO 1
114#define __UAPI_DEF_IP6_MTUINFO 1
109 115
110/* Definitions for xattr.h */116/* Definitions for xattr.h */
111#define __UAPI_DEF_XATTR 1117#define __UAPI_DEF_XATTR 1