summaryrefslogtreecommitdiff
path: root/harmony/iproute2/musl-fixes.patch
blob: 0149f6daeb46afcb4e487e81bfac036b2bd06b26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
--- include/linux/if_ether.h	2017-07-06 11:09:53.305214044 -0700
+++ include/linux/if_ether.h	2017-07-06 16:30:06.651369931 -0700
@@ -22,6 +22,7 @@
 #define _LINUX_IF_ETHER_H
 
 #include <linux/types.h>
+#include <linux/libc-compat.h>
 
 /*
  *	IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
@@ -142,11 +143,13 @@
  *	This is an Ethernet frame header.
  */
 
+#if __UAPI_DEF_ETHHDR
 struct ethhdr {
 	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
 	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
 	__be16		h_proto;		/* packet type ID field	*/
 } __attribute__((packed));
+#endif
 
 
 #endif /* _LINUX_IF_ETHER_H */
--- include/linux/if_tunnel.h	2017-07-06 11:09:53.305214044 -0700
+++ include/linux/if_tunnel.h	2017-07-06 16:32:23.814172660 -0700
@@ -2,7 +2,6 @@
 #define _IF_TUNNEL_H_
 
 #include <linux/types.h>
-#include <linux/if.h>
 #include <linux/ip.h>
 #include <linux/in6.h>
 #include <asm/byteorder.h>
--- include/linux/ip6_tunnel.h	2017-07-06 11:09:53.303214021 -0700
+++ include/linux/ip6_tunnel.h	2017-07-06 16:33:41.630158864 -0700
@@ -2,7 +2,6 @@
 #define _IP6_TUNNEL_H
 
 #include <linux/types.h>
-#include <linux/if.h>		/* For IFNAMSIZ. */
 #include <linux/in6.h>		/* For struct in6_addr. */
 
 #define IPV6_TLV_TNL_ENCAP_LIMIT 4
--- include/linux/kernel.h	2017-07-06 11:09:53.303214021 -0700
+++ include/linux/kernel.h	2017-07-06 16:30:06.650369918 -0700
@@ -1,7 +1,9 @@
 #ifndef _LINUX_KERNEL_H
 #define _LINUX_KERNEL_H
 
+#ifdef __GLIBC__
 #include <linux/sysinfo.h>
+#endif
 
 /*
  * 'kernel.h' contains some often-used function prototypes etc
--- include/linux/libc-compat.h	2017-07-06 11:09:53.302214010 -0700
+++ include/linux/libc-compat.h	2017-07-06 16:30:06.650369918 -0700
@@ -48,47 +48,57 @@
 #ifndef _LIBC_COMPAT_H
 #define _LIBC_COMPAT_H
 
-/* We have included glibc headers... */
-#if defined(__GLIBC__)
+/* We're used from userspace... */
+#if !defined(__KERNEL__)
 
-/* Coordinate with glibc net/if.h header. */
+/* Coordinate with libc net/if.h header. */
 #if defined(_NET_IF_H) && defined(__USE_MISC)
 
-/* GLIBC headers included first so don't define anything
+/* libc headers included first so don't define anything
  * that would already be defined. */
 
 #define __UAPI_DEF_IF_IFCONF 0
 #define __UAPI_DEF_IF_IFMAP 0
 #define __UAPI_DEF_IF_IFNAMSIZ 0
 #define __UAPI_DEF_IF_IFREQ 0
-/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
 #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
-/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
+/* If libc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
+#if !defined(__GLIBC__)
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
+#else
 #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
 #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
 #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
+#endif /* !defined(__GLIBC__) */
 
 #else /* _NET_IF_H */
 
 /* Linux headers included first, and we must define everything
- * we need. The expectation is that glibc will check the
+ * we need. The expectation is that libc will check the
  * __UAPI_DEF_* defines and adjust appropriately. */
 
 #define __UAPI_DEF_IF_IFCONF 1
 #define __UAPI_DEF_IF_IFMAP 1
 #define __UAPI_DEF_IF_IFNAMSIZ 1
 #define __UAPI_DEF_IF_IFREQ 1
-/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
 #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
-/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
+/* If libc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
 #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
 
 #endif /* _NET_IF_H */
 
-/* Coordinate with glibc netinet/in.h header. */
+/* Coordinate with libc netinet/if_ether.h */
+#ifdef _NETINET_IF_ETHER_H
+#define __UAPI_DEF_ETHHDR 0
+#else
+/* glibc uses __NETINET_IF_ETHER_H and uses the uapi header */
+#define __UAPI_DEF_ETHHDR 1
+#endif /* _NETINET_IF_ETHER_H */
+
+/* Coordinate with libc netinet/in.h header. */
 #if defined(_NETINET_IN_H)
 
-/* GLIBC headers included first so don't define anything
+/* libc headers included first so don't define anything
  * that would already be defined. */
 #define __UAPI_DEF_IN_ADDR		0
 #define __UAPI_DEF_IN_IPPROTO		0
@@ -98,15 +108,7 @@
 #define __UAPI_DEF_IN_CLASS		0
 
 #define __UAPI_DEF_IN6_ADDR		0
-/* The exception is the in6_addr macros which must be defined
- * if the glibc code didn't define them. This guard matches
- * the guard in glibc/inet/netinet/in.h which defines the
- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
-#if defined(__USE_MISC) || defined (__USE_GNU)
 #define __UAPI_DEF_IN6_ADDR_ALT		0
-#else
-#define __UAPI_DEF_IN6_ADDR_ALT		1
-#endif
 #define __UAPI_DEF_SOCKADDR_IN6		0
 #define __UAPI_DEF_IPV6_MREQ		0
 #define __UAPI_DEF_IPPROTO_V6		0
@@ -117,7 +119,7 @@
 #else
 
 /* Linux headers included first, and we must define everything
- * we need. The expectation is that glibc will check the
+ * we need. The expectation is that libc will check the
  * __UAPI_DEF_* defines and adjust appropriately. */
 #define __UAPI_DEF_IN_ADDR		1
 #define __UAPI_DEF_IN_IPPROTO		1
@@ -127,7 +129,7 @@
 #define __UAPI_DEF_IN_CLASS		1
 
 #define __UAPI_DEF_IN6_ADDR		1
-/* We unconditionally define the in6_addr macros and glibc must
+/* We unconditionally define the in6_addr macros and libc must
  * coordinate. */
 #define __UAPI_DEF_IN6_ADDR_ALT		1
 #define __UAPI_DEF_SOCKADDR_IN6		1
@@ -168,18 +170,20 @@
 /* If we did not see any headers from any supported C libraries,
  * or we are being included in the kernel, then define everything
  * that we need. */
-#else /* !defined(__GLIBC__) */
+#else /* defined(__KERNEL__) */
 
 /* Definitions for if.h */
 #define __UAPI_DEF_IF_IFCONF 1
 #define __UAPI_DEF_IF_IFMAP 1
 #define __UAPI_DEF_IF_IFNAMSIZ 1
 #define __UAPI_DEF_IF_IFREQ 1
-/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
 #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
-/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
+/* If libc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
 #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
 
+/* Definitions for if/ether.h */
+#define __UAPI_DEF_ETHHDR 1
+
 /* Definitions for in.h */
 #define __UAPI_DEF_IN_ADDR		1
 #define __UAPI_DEF_IN_IPPROTO		1
@@ -208,6 +212,6 @@
 /* Definitions for xattr.h */
 #define __UAPI_DEF_XATTR		1
 
-#endif /* __GLIBC__ */
+#endif /* defined(__KERNEL__) */
 
 #endif /* _LIBC_COMPAT_H */
--- include/linux/netfilter_ipv4/ip_tables.h	2017-07-06 11:09:53.310214100 -0700
+++ include/linux/netfilter_ipv4/ip_tables.h	2017-07-06 16:38:57.526211238 -0700
@@ -17,7 +17,6 @@
 
 #include <linux/types.h>
 
-#include <linux/if.h>
 #include <linux/netfilter_ipv4.h>
 
 #include <linux/netfilter/x_tables.h>
--- tc/f_flower.c	2017-07-06 11:09:53.289213865 -0700
+++ tc/f_flower.c	2017-07-06 16:36:04.967030780 -0700
@@ -15,7 +15,7 @@
 #include <syslog.h>
 #include <string.h>
 #include <net/if.h>
-#include <linux/if_arp.h>
+#include <net/if_arp.h>
 #include <linux/if_ether.h>
 #include <linux/ip.h>
 #include <linux/tc_act/tc_vlan.h>