diff options
author | Mikko Rapeli <mikko.rapeli@iki.fi> | 2016-08-22 14:33:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-22 19:25:15 -0400 |
commit | 53dc65d4d33c422d086c9d9ad8c03ab400ffc0a1 (patch) | |
tree | 4dd2b23efb3f7fa13a92c29799bb827dbe7ed494 | |
parent | a1d1f65ff5ac27276a585b41a619d30995bb92fe (diff) |
include/uapi/linux/ipx.h: fix conflicting defitions with glibc netipx/ipx.h
Fixes these compiler warnings via libc-compat.h when glibc netipx/ipx.h is
included before linux/ipx.h:
./linux/ipx.h:9:8: error: redefinition of ‘struct sockaddr_ipx’
./linux/ipx.h:26:8: error: redefinition of ‘struct ipx_route_definition’
./linux/ipx.h:32:8: error: redefinition of ‘struct ipx_interface_definition’
./linux/ipx.h:49:8: error: redefinition of ‘struct ipx_config_data’
./linux/ipx.h:58:8: error: redefinition of ‘struct ipx_route_def’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/uapi/linux/ipx.h | 13 | ||||
-rw-r--r-- | include/uapi/linux/libc-compat.h | 26 |
2 files changed, 38 insertions, 1 deletions
diff --git a/include/uapi/linux/ipx.h b/include/uapi/linux/ipx.h index 3d48014cdd71..30f031db12f6 100644 --- a/include/uapi/linux/ipx.h +++ b/include/uapi/linux/ipx.h | |||
@@ -1,11 +1,13 @@ | |||
1 | #ifndef _IPX_H_ | 1 | #ifndef _IPX_H_ |
2 | #define _IPX_H_ | 2 | #define _IPX_H_ |
3 | #include <linux/libc-compat.h> /* for compatibility with glibc netipx/ipx.h */ | ||
3 | #include <linux/types.h> | 4 | #include <linux/types.h> |
4 | #include <linux/sockios.h> | 5 | #include <linux/sockios.h> |
5 | #include <linux/socket.h> | 6 | #include <linux/socket.h> |
6 | #define IPX_NODE_LEN 6 | 7 | #define IPX_NODE_LEN 6 |
7 | #define IPX_MTU 576 | 8 | #define IPX_MTU 576 |
8 | 9 | ||
10 | #if __UAPI_DEF_SOCKADDR_IPX | ||
9 | struct sockaddr_ipx { | 11 | struct sockaddr_ipx { |
10 | __kernel_sa_family_t sipx_family; | 12 | __kernel_sa_family_t sipx_family; |
11 | __be16 sipx_port; | 13 | __be16 sipx_port; |
@@ -14,6 +16,7 @@ struct sockaddr_ipx { | |||
14 | __u8 sipx_type; | 16 | __u8 sipx_type; |
15 | unsigned char sipx_zero; /* 16 byte fill */ | 17 | unsigned char sipx_zero; /* 16 byte fill */ |
16 | }; | 18 | }; |
19 | #endif /* __UAPI_DEF_SOCKADDR_IPX */ | ||
17 | 20 | ||
18 | /* | 21 | /* |
19 | * So we can fit the extra info for SIOCSIFADDR into the address nicely | 22 | * So we can fit the extra info for SIOCSIFADDR into the address nicely |
@@ -23,12 +26,15 @@ struct sockaddr_ipx { | |||
23 | #define IPX_DLTITF 0 | 26 | #define IPX_DLTITF 0 |
24 | #define IPX_CRTITF 1 | 27 | #define IPX_CRTITF 1 |
25 | 28 | ||
29 | #if __UAPI_DEF_IPX_ROUTE_DEFINITION | ||
26 | struct ipx_route_definition { | 30 | struct ipx_route_definition { |
27 | __be32 ipx_network; | 31 | __be32 ipx_network; |
28 | __be32 ipx_router_network; | 32 | __be32 ipx_router_network; |
29 | unsigned char ipx_router_node[IPX_NODE_LEN]; | 33 | unsigned char ipx_router_node[IPX_NODE_LEN]; |
30 | }; | 34 | }; |
35 | #endif /* __UAPI_DEF_IPX_ROUTE_DEFINITION */ | ||
31 | 36 | ||
37 | #if __UAPI_DEF_IPX_INTERFACE_DEFINITION | ||
32 | struct ipx_interface_definition { | 38 | struct ipx_interface_definition { |
33 | __be32 ipx_network; | 39 | __be32 ipx_network; |
34 | unsigned char ipx_device[16]; | 40 | unsigned char ipx_device[16]; |
@@ -45,16 +51,20 @@ struct ipx_interface_definition { | |||
45 | #define IPX_INTERNAL 2 | 51 | #define IPX_INTERNAL 2 |
46 | unsigned char ipx_node[IPX_NODE_LEN]; | 52 | unsigned char ipx_node[IPX_NODE_LEN]; |
47 | }; | 53 | }; |
48 | 54 | #endif /* __UAPI_DEF_IPX_INTERFACE_DEFINITION */ | |
55 | |||
56 | #if __UAPI_DEF_IPX_CONFIG_DATA | ||
49 | struct ipx_config_data { | 57 | struct ipx_config_data { |
50 | unsigned char ipxcfg_auto_select_primary; | 58 | unsigned char ipxcfg_auto_select_primary; |
51 | unsigned char ipxcfg_auto_create_interfaces; | 59 | unsigned char ipxcfg_auto_create_interfaces; |
52 | }; | 60 | }; |
61 | #endif /* __UAPI_DEF_IPX_CONFIG_DATA */ | ||
53 | 62 | ||
54 | /* | 63 | /* |
55 | * OLD Route Definition for backward compatibility. | 64 | * OLD Route Definition for backward compatibility. |
56 | */ | 65 | */ |
57 | 66 | ||
67 | #if __UAPI_DEF_IPX_ROUTE_DEF | ||
58 | struct ipx_route_def { | 68 | struct ipx_route_def { |
59 | __be32 ipx_network; | 69 | __be32 ipx_network; |
60 | __be32 ipx_router_network; | 70 | __be32 ipx_router_network; |
@@ -67,6 +77,7 @@ struct ipx_route_def { | |||
67 | #define IPX_RT_BLUEBOOK 2 | 77 | #define IPX_RT_BLUEBOOK 2 |
68 | #define IPX_RT_ROUTED 1 | 78 | #define IPX_RT_ROUTED 1 |
69 | }; | 79 | }; |
80 | #endif /* __UAPI_DEF_IPX_ROUTE_DEF */ | ||
70 | 81 | ||
71 | #define SIOCAIPXITFCRT (SIOCPROTOPRIVATE) | 82 | #define SIOCAIPXITFCRT (SIOCPROTOPRIVATE) |
72 | #define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1) | 83 | #define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1) |
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h index e4f048ee7043..44b8a6bd5fe1 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h | |||
@@ -139,6 +139,25 @@ | |||
139 | 139 | ||
140 | #endif /* _NETINET_IN_H */ | 140 | #endif /* _NETINET_IN_H */ |
141 | 141 | ||
142 | /* Coordinate with glibc netipx/ipx.h header. */ | ||
143 | #if defined(__NETIPX_IPX_H) | ||
144 | |||
145 | #define __UAPI_DEF_SOCKADDR_IPX 0 | ||
146 | #define __UAPI_DEF_IPX_ROUTE_DEFINITION 0 | ||
147 | #define __UAPI_DEF_IPX_INTERFACE_DEFINITION 0 | ||
148 | #define __UAPI_DEF_IPX_CONFIG_DATA 0 | ||
149 | #define __UAPI_DEF_IPX_ROUTE_DEF 0 | ||
150 | |||
151 | #else /* defined(__NETIPX_IPX_H) */ | ||
152 | |||
153 | #define __UAPI_DEF_SOCKADDR_IPX 1 | ||
154 | #define __UAPI_DEF_IPX_ROUTE_DEFINITION 1 | ||
155 | #define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1 | ||
156 | #define __UAPI_DEF_IPX_CONFIG_DATA 1 | ||
157 | #define __UAPI_DEF_IPX_ROUTE_DEF 1 | ||
158 | |||
159 | #endif /* defined(__NETIPX_IPX_H) */ | ||
160 | |||
142 | /* Definitions for xattr.h */ | 161 | /* Definitions for xattr.h */ |
143 | #if defined(_SYS_XATTR_H) | 162 | #if defined(_SYS_XATTR_H) |
144 | #define __UAPI_DEF_XATTR 0 | 163 | #define __UAPI_DEF_XATTR 0 |
@@ -179,6 +198,13 @@ | |||
179 | #define __UAPI_DEF_IN6_PKTINFO 1 | 198 | #define __UAPI_DEF_IN6_PKTINFO 1 |
180 | #define __UAPI_DEF_IP6_MTUINFO 1 | 199 | #define __UAPI_DEF_IP6_MTUINFO 1 |
181 | 200 | ||
201 | /* Definitions for ipx.h */ | ||
202 | #define __UAPI_DEF_SOCKADDR_IPX 1 | ||
203 | #define __UAPI_DEF_IPX_ROUTE_DEFINITION 1 | ||
204 | #define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1 | ||
205 | #define __UAPI_DEF_IPX_CONFIG_DATA 1 | ||
206 | #define __UAPI_DEF_IPX_ROUTE_DEF 1 | ||
207 | |||
182 | /* Definitions for xattr.h */ | 208 | /* Definitions for xattr.h */ |
183 | #define __UAPI_DEF_XATTR 1 | 209 | #define __UAPI_DEF_XATTR 1 |
184 | 210 | ||