blob: 951bebc9015d60a01b318c7e3955556334c76e4e [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From f95192d87a46a2191cf4ebd47c64e04b138d7fac Mon Sep 17 00:00:00 2001
Andrew Geissler82c905d2020-04-13 13:39:40 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 26 Oct 2017 22:10:42 -0700
William A. Kennington IIIac69b482021-06-02 12:28:27 -07004Subject: [PATCH] Include netinet/if_ether.h
Brad Bishop19323692019-04-05 15:28:33 -04005
6Fixes
7/path/to/systemd/recipe-sysroot/usr/include/netinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr'
8 struct ethhdr {
9 ^~~~~~
10
Brad Bishopa34c0302019-09-23 22:34:48 -040011and related arphdr, arpreq, and arpreq_old errors
12/path/to/systemd/recipe-sysroot/usr/include/net/if_arp.h:22:8: error: redefinition of 'struct arphdr'
13 struct arphdr {
14 ^~~~~~
15
16The latter requires removing some includes of net/if_arp.h to avoid
17conflicting with netinet/if_ether.h.
18
Brad Bishop19323692019-04-05 15:28:33 -040019Upstream-Status: Inappropriate [musl specific]
20
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Brad Bishopa34c0302019-09-23 22:34:48 -040023[rebased for systemd 243]
24Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Brad Bishop19323692019-04-05 15:28:33 -040025
Brad Bishopa34c0302019-09-23 22:34:48 -040026Upstream-Status: Inappropriate [musl specific]
27
28Signed-off-by: Khem Raj <raj.khem@gmail.com>
29Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
30[rebased for systemd 243]
31Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Andrew Geisslerd1e89492021-02-12 15:35:20 -060032[rebased for systemd 247]
33Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
William A. Kennington IIIac69b482021-06-02 12:28:27 -070034
Brad Bishopa34c0302019-09-23 22:34:48 -040035---
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050036 src/basic/linux/in6.h | 14 +++++++-------
37 src/libsystemd-network/sd-dhcp6-client.c | 1 -
38 src/libsystemd/sd-netlink/netlink-types.c | 1 +
39 src/machine/machine-dbus.c | 1 +
40 src/network/netdev/bond.c | 1 +
41 src/network/netdev/bridge.c | 1 +
42 src/network/netdev/macsec.c | 1 +
43 src/network/netdev/netdev-gperf.gperf | 1 +
44 src/network/netdev/netdev.c | 1 +
45 src/network/networkd-bridge-vlan.c | 1 +
46 src/network/networkd-dhcp-common.c | 4 +++-
47 src/network/networkd-dhcp-server.c | 4 ++--
48 src/network/networkd-dhcp4.c | 2 +-
49 src/network/networkd-dhcp6.c | 2 +-
50 src/network/networkd-link.c | 2 +-
51 src/network/networkd-network.c | 1 +
52 src/network/networkd-route.c | 1 +
53 src/network/networkd-setlink.c | 2 +-
54 src/network/test-network-tables.c | 1 +
55 src/shared/ethtool-util.c | 1 +
56 src/shared/ethtool-util.h | 1 +
57 src/udev/net/link-config.c | 1 +
58 src/udev/udev-builtin-net_setup_link.c | 1 +
59 23 files changed, 31 insertions(+), 15 deletions(-)
Brad Bishopa34c0302019-09-23 22:34:48 -040060
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050061diff --git a/src/basic/linux/in6.h b/src/basic/linux/in6.h
62index 5ad396a57e..1dc007fe13 100644
Patrick Williams213cb262021-08-07 19:21:33 -050063--- a/src/basic/linux/in6.h
64+++ b/src/basic/linux/in6.h
65@@ -1,10 +1,10 @@
66 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
67 /*
68- * Types and definitions for AF_INET6
69- * Linux INET6 implementation
70+ * Types and definitions for AF_INET6
71+ * Linux INET6 implementation
72 *
73 * Authors:
74- * Pedro Roque <roque@di.fc.ul.pt>
75+ * Pedro Roque <roque@di.fc.ul.pt>
76 *
77 * Sources:
78 * IPv6 Program Interfaces for BSD Systems
79@@ -19,8 +19,8 @@
80 * 2 of the License, or (at your option) any later version.
81 */
82
83-#ifndef _UAPI_LINUX_IN6_H
84-#define _UAPI_LINUX_IN6_H
85+#ifndef _LINUX_IN6_H
86+#define _LINUX_IN6_H
87
88 #include <linux/types.h>
89 #include <linux/libc-compat.h>
90@@ -97,7 +97,7 @@ struct in6_flowlabel_req {
91
92
93 /*
94- * Bitmask constant declarations to help applications select out the
95+ * Bitmask constant declarations to help applications select out the
96 * flow label and priority fields.
97 *
98 * Note that this are in host byte order while the flowinfo field of
99@@ -298,4 +298,4 @@ struct in6_flowlabel_req {
100 * ...
101 * MRT6_MAX
102 */
103-#endif /* _UAPI_LINUX_IN6_H */
104+#endif /* _LINUX_IN6_H */
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500105diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
Andrew Geisslereff27472021-10-29 15:35:00 -0500106index f99c12620b..4966d62656 100644
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500107--- a/src/libsystemd-network/sd-dhcp6-client.c
108+++ b/src/libsystemd-network/sd-dhcp6-client.c
109@@ -5,7 +5,6 @@
110
111 #include <errno.h>
112 #include <sys/ioctl.h>
113-#include <linux/if_arp.h>
114 #include <linux/if_infiniband.h>
115
116 #include "sd-dhcp6-client.h"
117diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
118index beb926d40b..41de212242 100644
119--- a/src/libsystemd/sd-netlink/netlink-types.c
120+++ b/src/libsystemd/sd-netlink/netlink-types.c
121@@ -3,6 +3,7 @@
122 #include <netinet/in.h>
123 #include <stdint.h>
124 #include <sys/socket.h>
125+#include <netinet/if_ether.h>
126 #include <linux/can/vxcan.h>
127 #include <linux/netlink.h>
128 #include <linux/rtnetlink.h>
129diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
130index 0022a980c5..fc22e51409 100644
131--- a/src/machine/machine-dbus.c
132+++ b/src/machine/machine-dbus.c
133@@ -3,6 +3,7 @@
134 #include <errno.h>
135 #include <sys/mount.h>
136 #include <sys/wait.h>
137+#include <netinet/if_ether.h>
138
139 /* When we include libgen.h because we need dirname() we immediately
140 * undefine basename() since libgen.h defines it as a macro to the POSIX
141diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c
142index a7a4adce45..eb111a6c48 100644
143--- a/src/network/netdev/bond.c
144+++ b/src/network/netdev/bond.c
145@@ -1,5 +1,6 @@
146 /* SPDX-License-Identifier: LGPL-2.1-or-later */
147
148+#include <netinet/if_ether.h>
149 #include "alloc-util.h"
150 #include "bond.h"
151 #include "bond-util.h"
152diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c
153index 99fb9e1c3c..ecc6ca91bf 100644
154--- a/src/network/netdev/bridge.c
155+++ b/src/network/netdev/bridge.c
156@@ -1,5 +1,6 @@
157 /* SPDX-License-Identifier: LGPL-2.1-or-later */
158
159+#include <netinet/if_ether.h>
160 #include <net/if.h>
161
162 #include "bridge.h"
163diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c
164index 77c5f8c4e7..04be1b4ab2 100644
165--- a/src/network/netdev/macsec.c
166+++ b/src/network/netdev/macsec.c
167@@ -1,5 +1,6 @@
168 /* SPDX-License-Identifier: LGPL-2.1-or-later */
169
170+#include <netinet/if_ether.h>
171 #include <netinet/in.h>
172 #include <linux/if_ether.h>
173 #include <linux/if_macsec.h>
174diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf
175index 9dd081425e..130e5b3d3c 100644
176--- a/src/network/netdev/netdev-gperf.gperf
177+++ b/src/network/netdev/netdev-gperf.gperf
178@@ -3,6 +3,7 @@
179 #if __GNUC__ >= 7
180 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
181 #endif
182+#include <netinet/if_ether.h>
183 #include <stddef.h>
184 #include "bareudp.h"
185 #include "batadv.h"
186diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c
187index 53534d4873..1cfda9469f 100644
188--- a/src/network/netdev/netdev.c
189+++ b/src/network/netdev/netdev.c
190@@ -1,5 +1,6 @@
191 /* SPDX-License-Identifier: LGPL-2.1-or-later */
192
193+#include <netinet/if_ether.h>
194 #include <net/if.h>
195 #include <netinet/in.h>
196 #include <unistd.h>
197diff --git a/src/network/networkd-bridge-vlan.c b/src/network/networkd-bridge-vlan.c
198index 3153bf6984..687a26b057 100644
199--- a/src/network/networkd-bridge-vlan.c
200+++ b/src/network/networkd-bridge-vlan.c
201@@ -4,6 +4,7 @@
202 ***/
203
204 #include <netinet/in.h>
205+#include <netinet/if_ether.h>
206 #include <linux/if_bridge.h>
207 #include <stdbool.h>
208
209diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c
210index 249d780887..edd2e9adf8 100644
211--- a/src/network/networkd-dhcp-common.c
212+++ b/src/network/networkd-dhcp-common.c
213@@ -1,7 +1,8 @@
214 /* SPDX-License-Identifier: LGPL-2.1-or-later */
215
216 #include <netinet/in.h>
217-#include <linux/if_arp.h>
218+#include <net/if_arp.h>
219+#include <net/if.h>
220
221 #include "bus-error.h"
222 #include "dhcp-identifier.h"
223@@ -13,6 +14,7 @@
224 #include "networkd-dhcp-common.h"
225 #include "networkd-link.h"
226 #include "networkd-manager.h"
227+#include <netinet/if_ether.h>
228 #include "networkd-network.h"
229 #include "parse-util.h"
230 #include "socket-util.h"
231diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c
232index 9e2faa5675..fd8d817569 100644
233--- a/src/network/networkd-dhcp-server.c
234+++ b/src/network/networkd-dhcp-server.c
235@@ -1,8 +1,8 @@
236 /* SPDX-License-Identifier: LGPL-2.1-or-later */
237
238 #include <netinet/in.h>
239-#include <linux/if_arp.h>
240-#include <linux/if.h>
241+#include <net/if_arp.h>
242+#include <net/if.h>
243
244 #include "sd-dhcp-server.h"
245
246diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
247index f80adcdbcf..3311e2a718 100644
248--- a/src/network/networkd-dhcp4.c
249+++ b/src/network/networkd-dhcp4.c
250@@ -1,9 +1,9 @@
251 /* SPDX-License-Identifier: LGPL-2.1-or-later */
252
253+#include <netinet/if_ether.h>
254 #include <netinet/in.h>
255 #include <netinet/ip.h>
256 #include <linux/if.h>
257-#include <linux/if_arp.h>
258
259 #include "escape.h"
260 #include "alloc-util.h"
261diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
262index 2b72b618fc..d0d4cfb384 100644
263--- a/src/network/networkd-dhcp6.c
264+++ b/src/network/networkd-dhcp6.c
265@@ -3,9 +3,9 @@
266 Copyright © 2014 Intel Corporation. All rights reserved.
267 ***/
268
269+#include <netinet/if_ether.h>
270 #include <netinet/in.h>
271 #include <linux/if.h>
272-#include <linux/if_arp.h>
273
274 #include "sd-dhcp6-client.h"
275
276diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
Andrew Geisslereff27472021-10-29 15:35:00 -0500277index 20675f2306..2884511ff3 100644
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500278--- a/src/network/networkd-link.c
279+++ b/src/network/networkd-link.c
Andrew Geisslereff27472021-10-29 15:35:00 -0500280@@ -1,9 +1,9 @@
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500281 /* SPDX-License-Identifier: LGPL-2.1-or-later */
282
Andrew Geisslereff27472021-10-29 15:35:00 -0500283 #include <net/if.h>
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500284+#include <netinet/if_ether.h>
285 #include <netinet/in.h>
286 #include <linux/if.h>
287-#include <linux/if_arp.h>
288 #include <linux/if_link.h>
289 #include <linux/netdevice.h>
290 #include <sys/socket.h>
291diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
292index 850b4f449e..6f85d41328 100644
293--- a/src/network/networkd-network.c
294+++ b/src/network/networkd-network.c
295@@ -1,5 +1,6 @@
296 /* SPDX-License-Identifier: LGPL-2.1-or-later */
297
298+#include <netinet/if_ether.h>
299 #include <net/if.h>
300 #include <netinet/in.h>
301 #include <linux/netdevice.h>
302diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
Andrew Geisslereff27472021-10-29 15:35:00 -0500303index 791fd64c39..a2825c920d 100644
Patrick Williams213cb262021-08-07 19:21:33 -0500304--- a/src/network/networkd-route.c
305+++ b/src/network/networkd-route.c
306@@ -1,5 +1,6 @@
307 /* SPDX-License-Identifier: LGPL-2.1-or-later */
308
309+#include <netinet/in.h>
310 #include <linux/icmpv6.h>
311 #include <linux/ipv6_route.h>
312 #include <linux/nexthop.h>
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500313diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c
Andrew Geisslereff27472021-10-29 15:35:00 -0500314index 13c4cedd10..6558d551ab 100644
Patrick Williams213cb262021-08-07 19:21:33 -0500315--- a/src/network/networkd-setlink.c
316+++ b/src/network/networkd-setlink.c
317@@ -1,8 +1,8 @@
318 /* SPDX-License-Identifier: LGPL-2.1-or-later */
319
320 #include <netinet/in.h>
321+#include <net/if_arp.h>
322 #include <linux/if.h>
323-#include <linux/if_arp.h>
324
325 #include "missing_network.h"
326 #include "netlink-util.h"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500327diff --git a/src/network/test-network-tables.c b/src/network/test-network-tables.c
328index f55e524ae9..83d5c7cef3 100644
329--- a/src/network/test-network-tables.c
330+++ b/src/network/test-network-tables.c
331@@ -1,5 +1,6 @@
332 /* SPDX-License-Identifier: LGPL-2.1-or-later */
333
334+#include <netinet/if_ether.h>
335 #include "bond.h"
336 #include "dhcp6-internal.h"
337 #include "dhcp6-protocol.h"
338diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c
339index f77f6943ca..0e1506e04b 100644
340--- a/src/shared/ethtool-util.c
341+++ b/src/shared/ethtool-util.c
342@@ -1,5 +1,6 @@
343 /* SPDX-License-Identifier: LGPL-2.1-or-later */
344
345+#include <netinet/if_ether.h>
346 #include <net/if.h>
347 #include <sys/ioctl.h>
348 #include <linux/ethtool.h>
349diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h
350index 7d28766624..e98a25418b 100644
351--- a/src/shared/ethtool-util.h
352+++ b/src/shared/ethtool-util.h
353@@ -3,6 +3,7 @@
354
355 #include <macro.h>
356 #include <net/ethernet.h>
357+#include <netinet/if_ether.h>
358 #include <linux/ethtool.h>
359
360 #include "conf-parser.h"
361diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
362index 8dfe23691b..e269856337 100644
363--- a/src/udev/net/link-config.c
364+++ b/src/udev/net/link-config.c
365@@ -1,5 +1,6 @@
366 /* SPDX-License-Identifier: LGPL-2.1-or-later */
367
368+#include <netinet/if_ether.h>
369 #include <linux/netdevice.h>
370 #include <netinet/ether.h>
371 #include <unistd.h>
372diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
Andrew Geisslereff27472021-10-29 15:35:00 -0500373index 5964e30bf1..52a18d7a7f 100644
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500374--- a/src/udev/udev-builtin-net_setup_link.c
375+++ b/src/udev/udev-builtin-net_setup_link.c
376@@ -1,5 +1,6 @@
377 /* SPDX-License-Identifier: LGPL-2.1-or-later */
378
379+#include <netinet/if_ether.h>
380 #include "alloc-util.h"
381 #include "device-util.h"
382 #include "errno-util.h"