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.
Showing the changes to include/uapi/linux (2 of 2 files). Show all
Unified · Split
| @@ -15,16 +15,19 @@ · 14 unmodified lines | ||
| 15 | 15 | * *under construction* |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | − | |
| 18 | +#if __UAPI_DEF_IN6_PKTINFO | |
| 19 | 19 | struct in6_pktinfo { |
| 20 | 20 | struct in6_addr ipi6_addr; |
| 21 | 21 | int ipi6_ifindex; |
| 22 | 22 | }; |
| 23 | +#endif | |
| 23 | 24 | |
| 25 | +#if __UAPI_DEF_IP6_MTUINFO | |
| 24 | 26 | struct ip6_mtuinfo { |
| 25 | 27 | struct sockaddr_in6 ip6m_addr; |
| 26 | 28 | __u32 ip6m_mtu; |
| 27 | 29 | }; |
| 30 | +#endif | |
| 28 | 31 | |
| 29 | 32 | struct in6_ifreq { |
| 30 | 33 | struct in6_addr ifr6_addr; |
| @@ -70,6 +70,8 @@ · 69 unmodified lines | ||
| 70 | 70 | #define __UAPI_DEF_IPV6_MREQ 0 |
| 71 | 71 | #define __UAPI_DEF_IPPROTO_V6 0 |
| 72 | 72 | #define __UAPI_DEF_IPV6_OPTIONS 0 |
| 73 | +#define __UAPI_DEF_IN6_PKTINFO 0 | |
| 74 | +#define __UAPI_DEF_IP6_MTUINFO 0 | |
| 73 | 75 | |
| 74 | 76 | #else |
| 75 | 77 | |
| @@ -84,6 +86,8 @@ · 8 unmodified lines | ||
| 84 | 86 | #define __UAPI_DEF_IPV6_MREQ 1 |
| 85 | 87 | #define __UAPI_DEF_IPPROTO_V6 1 |
| 86 | 88 | #define __UAPI_DEF_IPV6_OPTIONS 1 |
| 89 | +#define __UAPI_DEF_IN6_PKTINFO 1 | |
| 90 | +#define __UAPI_DEF_IP6_MTUINFO 1 | |
| 87 | 91 | |
| 88 | 92 | #endif /* _NETINET_IN_H */ |
| 89 | 93 | |
| @@ -106,6 +110,8 @@ · 16 unmodified lines | ||
| 106 | 110 | #define __UAPI_DEF_IPV6_MREQ 1 |
| 107 | 111 | #define __UAPI_DEF_IPPROTO_V6 1 |
| 108 | 112 | #define __UAPI_DEF_IPV6_OPTIONS 1 |
| 113 | +#define __UAPI_DEF_IN6_PKTINFO 1 | |
| 114 | +#define __UAPI_DEF_IP6_MTUINFO 1 | |
| 109 | 115 | |
| 110 | 116 | /* Definitions for xattr.h */ |
| 111 | 117 | #define __UAPI_DEF_XATTR 1 |