summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0006-Include-netinet-if_ether.h.patch
blob: 4ce168b6efa13e6bac54e05bd3d2d825c93d72e4 (plain)
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
From 8983334730df280a4e4dcb08e586b453bc1d53bd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 26 Oct 2017 22:10:42 -0700
Subject: [PATCH] Include netinet/if_ether.h

Fixes
/path/to/systemd/recipe-sysroot/usr/include/netinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr'
 struct ethhdr {
        ^~~~~~

and related arphdr, arpreq, and arpreq_old errors
/path/to/systemd/recipe-sysroot/usr/include/net/if_arp.h:22:8: error: redefinition of 'struct arphdr'
 struct arphdr {
        ^~~~~~

The latter requires removing some includes of net/if_arp.h to avoid
conflicting with netinet/if_ether.h.

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[rebased for systemd 243]
Signed-off-by: Scott Murray <scott.murray@konsulko.com>

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
[rebased for systemd 243]
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
[rebased for systemd 247]
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>

---
 src/basic/linux/in6.h                     | 14 +++++++-------
 src/libsystemd-network/sd-dhcp6-client.c  |  1 -
 src/libsystemd/sd-netlink/netlink-types.c |  1 +
 src/machine/machine-dbus.c                |  1 +
 src/network/netdev/bond.c                 |  1 +
 src/network/netdev/bridge.c               |  1 +
 src/network/netdev/macsec.c               |  1 +
 src/network/netdev/netdev-gperf.gperf     |  1 +
 src/network/netdev/netdev.c               |  1 +
 src/network/networkd-bridge-vlan.c        |  1 +
 src/network/networkd-dhcp-common.c        |  4 +++-
 src/network/networkd-dhcp-server.c        |  4 ++--
 src/network/networkd-dhcp4.c              |  2 +-
 src/network/networkd-dhcp6.c              |  2 +-
 src/network/networkd-link.c               |  2 +-
 src/network/networkd-network.c            |  1 +
 src/network/networkd-route.c              |  1 +
 src/network/networkd-setlink.c            |  2 +-
 src/network/test-network-tables.c         |  1 +
 src/shared/ethtool-util.c                 |  1 +
 src/shared/ethtool-util.h                 |  1 +
 src/udev/net/link-config.c                |  1 +
 src/udev/udev-builtin-net_setup_link.c    |  1 +
 23 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/src/basic/linux/in6.h b/src/basic/linux/in6.h
index 5ad396a57e..1dc007fe13 100644
--- a/src/basic/linux/in6.h
+++ b/src/basic/linux/in6.h
@@ -1,10 +1,10 @@
 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
 /*
- *	Types and definitions for AF_INET6 
- *	Linux INET6 implementation 
+ *	Types and definitions for AF_INET6
+ *	Linux INET6 implementation
  *
  *	Authors:
- *	Pedro Roque		<roque@di.fc.ul.pt>	
+ *	Pedro Roque		<roque@di.fc.ul.pt>
  *
  *	Sources:
  *	IPv6 Program Interfaces for BSD Systems
@@ -19,8 +19,8 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#ifndef _UAPI_LINUX_IN6_H
-#define _UAPI_LINUX_IN6_H
+#ifndef _LINUX_IN6_H
+#define _LINUX_IN6_H
 
 #include <linux/types.h>
 #include <linux/libc-compat.h>
@@ -97,7 +97,7 @@ struct in6_flowlabel_req {
 
 
 /*
- *	Bitmask constant declarations to help applications select out the 
+ *	Bitmask constant declarations to help applications select out the
  *	flow label and priority fields.
  *
  *	Note that this are in host byte order while the flowinfo field of
@@ -298,4 +298,4 @@ struct in6_flowlabel_req {
  * ...
  * MRT6_MAX
  */
-#endif /* _UAPI_LINUX_IN6_H */
+#endif /* _LINUX_IN6_H */
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index f99c12620b..4966d62656 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -5,7 +5,6 @@
 
 #include <errno.h>
 #include <sys/ioctl.h>
-#include <linux/if_arp.h>
 #include <linux/if_infiniband.h>
 
 #include "sd-dhcp6-client.h"
diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
index beb926d40b..41de212242 100644
--- a/src/libsystemd/sd-netlink/netlink-types.c
+++ b/src/libsystemd/sd-netlink/netlink-types.c
@@ -3,6 +3,7 @@
 #include <netinet/in.h>
 #include <stdint.h>
 #include <sys/socket.h>
+#include <netinet/if_ether.h>
 #include <linux/can/vxcan.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
index 0022a980c5..fc22e51409 100644
--- a/src/machine/machine-dbus.c
+++ b/src/machine/machine-dbus.c
@@ -3,6 +3,7 @@
 #include <errno.h>
 #include <sys/mount.h>
 #include <sys/wait.h>
+#include <netinet/if_ether.h>
 
 /* When we include libgen.h because we need dirname() we immediately
  * undefine basename() since libgen.h defines it as a macro to the POSIX
diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c
index a7a4adce45..eb111a6c48 100644
--- a/src/network/netdev/bond.c
+++ b/src/network/netdev/bond.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include "alloc-util.h"
 #include "bond.h"
 #include "bond-util.h"
diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c
index 99fb9e1c3c..ecc6ca91bf 100644
--- a/src/network/netdev/bridge.c
+++ b/src/network/netdev/bridge.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include <net/if.h>
 
 #include "bridge.h"
diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c
index 77c5f8c4e7..04be1b4ab2 100644
--- a/src/network/netdev/macsec.c
+++ b/src/network/netdev/macsec.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include <netinet/in.h>
 #include <linux/if_ether.h>
 #include <linux/if_macsec.h>
diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf
index 9dd081425e..130e5b3d3c 100644
--- a/src/network/netdev/netdev-gperf.gperf
+++ b/src/network/netdev/netdev-gperf.gperf
@@ -3,6 +3,7 @@
 #if __GNUC__ >= 7
 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
 #endif
+#include <netinet/if_ether.h>
 #include <stddef.h>
 #include "bareudp.h"
 #include "batadv.h"
diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c
index 53534d4873..1cfda9469f 100644
--- a/src/network/netdev/netdev.c
+++ b/src/network/netdev/netdev.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include <net/if.h>
 #include <netinet/in.h>
 #include <unistd.h>
diff --git a/src/network/networkd-bridge-vlan.c b/src/network/networkd-bridge-vlan.c
index 3153bf6984..687a26b057 100644
--- a/src/network/networkd-bridge-vlan.c
+++ b/src/network/networkd-bridge-vlan.c
@@ -4,6 +4,7 @@
 ***/
 
 #include <netinet/in.h>
+#include <netinet/if_ether.h>
 #include <linux/if_bridge.h>
 #include <stdbool.h>
 
diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c
index 249d780887..edd2e9adf8 100644
--- a/src/network/networkd-dhcp-common.c
+++ b/src/network/networkd-dhcp-common.c
@@ -1,7 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+#include <net/if_arp.h>
+#include <net/if.h>
 
 #include "bus-error.h"
 #include "dhcp-identifier.h"
@@ -13,6 +14,7 @@
 #include "networkd-dhcp-common.h"
 #include "networkd-link.h"
 #include "networkd-manager.h"
+#include <netinet/if_ether.h>
 #include "networkd-network.h"
 #include "parse-util.h"
 #include "socket-util.h"
diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c
index 9e2faa5675..fd8d817569 100644
--- a/src/network/networkd-dhcp-server.c
+++ b/src/network/networkd-dhcp-server.c
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <netinet/in.h>
-#include <linux/if_arp.h>
-#include <linux/if.h>
+#include <net/if_arp.h>
+#include <net/if.h>
 
 #include "sd-dhcp-server.h"
 
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index f80adcdbcf..3311e2a718 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
 
 #include "escape.h"
 #include "alloc-util.h"
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
index 2b72b618fc..d0d4cfb384 100644
--- a/src/network/networkd-dhcp6.c
+++ b/src/network/networkd-dhcp6.c
@@ -3,9 +3,9 @@
   Copyright © 2014 Intel Corporation. All rights reserved.
 ***/
 
+#include <netinet/if_ether.h>
 #include <netinet/in.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
 
 #include "sd-dhcp6-client.h"
 
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index d58b700050..bba1ca1cab 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <net/if.h>
+#include <netinet/if_ether.h>
 #include <netinet/in.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
 #include <linux/if_link.h>
 #include <linux/netdevice.h>
 #include <sys/socket.h>
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 850b4f449e..6f85d41328 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include <net/if.h>
 #include <netinet/in.h>
 #include <linux/netdevice.h>
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index b7852f6eec..72514f6a0d 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/in.h>
 #include <linux/icmpv6.h>
 #include <linux/ipv6_route.h>
 #include <linux/nexthop.h>
diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c
index 13c4cedd10..6558d551ab 100644
--- a/src/network/networkd-setlink.c
+++ b/src/network/networkd-setlink.c
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <netinet/in.h>
+#include <net/if_arp.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
 
 #include "missing_network.h"
 #include "netlink-util.h"
diff --git a/src/network/test-network-tables.c b/src/network/test-network-tables.c
index f55e524ae9..83d5c7cef3 100644
--- a/src/network/test-network-tables.c
+++ b/src/network/test-network-tables.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include "bond.h"
 #include "dhcp6-internal.h"
 #include "dhcp6-protocol.h"
diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c
index f77f6943ca..0e1506e04b 100644
--- a/src/shared/ethtool-util.c
+++ b/src/shared/ethtool-util.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include <net/if.h>
 #include <sys/ioctl.h>
 #include <linux/ethtool.h>
diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h
index 7d28766624..e98a25418b 100644
--- a/src/shared/ethtool-util.h
+++ b/src/shared/ethtool-util.h
@@ -3,6 +3,7 @@
 
 #include <macro.h>
 #include <net/ethernet.h>
+#include <netinet/if_ether.h>
 #include <linux/ethtool.h>
 
 #include "conf-parser.h"
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 8dfe23691b..e269856337 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include <linux/netdevice.h>
 #include <netinet/ether.h>
 #include <unistd.h>
diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
index 5964e30bf1..52a18d7a7f 100644
--- a/src/udev/udev-builtin-net_setup_link.c
+++ b/src/udev/udev-builtin-net_setup_link.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <netinet/if_ether.h>
 #include "alloc-util.h"
 #include "device-util.h"
 #include "errno-util.h"