blob: 855607e6a848323bdb5691e26fcc811bf38ceef0 [file] [log] [blame]
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05001From d7ae3aadc70555932e03349907f8be04d03a50ee 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
106index e8c47f429a..359922c1b3 100644
107--- 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
277index 9421ce1aa6..3e37cbcc39 100644
278--- a/src/network/networkd-link.c
279+++ b/src/network/networkd-link.c
280@@ -1,8 +1,8 @@
281 /* SPDX-License-Identifier: LGPL-2.1-or-later */
282
283+#include <netinet/if_ether.h>
284 #include <netinet/in.h>
285 #include <linux/if.h>
286-#include <linux/if_arp.h>
287 #include <linux/if_link.h>
288 #include <linux/netdevice.h>
289 #include <sys/socket.h>
290diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
291index 850b4f449e..6f85d41328 100644
292--- a/src/network/networkd-network.c
293+++ b/src/network/networkd-network.c
294@@ -1,5 +1,6 @@
295 /* SPDX-License-Identifier: LGPL-2.1-or-later */
296
297+#include <netinet/if_ether.h>
298 #include <net/if.h>
299 #include <netinet/in.h>
300 #include <linux/netdevice.h>
301diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
302index 77a93beca9..3bf9ae8837 100644
Patrick Williams213cb262021-08-07 19:21:33 -0500303--- a/src/network/networkd-route.c
304+++ b/src/network/networkd-route.c
305@@ -1,5 +1,6 @@
306 /* SPDX-License-Identifier: LGPL-2.1-or-later */
307
308+#include <netinet/in.h>
309 #include <linux/icmpv6.h>
310 #include <linux/ipv6_route.h>
311 #include <linux/nexthop.h>
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500312diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c
313index 10c312c480..e44fbb5c35 100644
Patrick Williams213cb262021-08-07 19:21:33 -0500314--- a/src/network/networkd-setlink.c
315+++ b/src/network/networkd-setlink.c
316@@ -1,8 +1,8 @@
317 /* SPDX-License-Identifier: LGPL-2.1-or-later */
318
319 #include <netinet/in.h>
320+#include <net/if_arp.h>
321 #include <linux/if.h>
322-#include <linux/if_arp.h>
323
324 #include "missing_network.h"
325 #include "netlink-util.h"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500326diff --git a/src/network/test-network-tables.c b/src/network/test-network-tables.c
327index f55e524ae9..83d5c7cef3 100644
328--- a/src/network/test-network-tables.c
329+++ b/src/network/test-network-tables.c
330@@ -1,5 +1,6 @@
331 /* SPDX-License-Identifier: LGPL-2.1-or-later */
332
333+#include <netinet/if_ether.h>
334 #include "bond.h"
335 #include "dhcp6-internal.h"
336 #include "dhcp6-protocol.h"
337diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c
338index f77f6943ca..0e1506e04b 100644
339--- a/src/shared/ethtool-util.c
340+++ b/src/shared/ethtool-util.c
341@@ -1,5 +1,6 @@
342 /* SPDX-License-Identifier: LGPL-2.1-or-later */
343
344+#include <netinet/if_ether.h>
345 #include <net/if.h>
346 #include <sys/ioctl.h>
347 #include <linux/ethtool.h>
348diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h
349index 7d28766624..e98a25418b 100644
350--- a/src/shared/ethtool-util.h
351+++ b/src/shared/ethtool-util.h
352@@ -3,6 +3,7 @@
353
354 #include <macro.h>
355 #include <net/ethernet.h>
356+#include <netinet/if_ether.h>
357 #include <linux/ethtool.h>
358
359 #include "conf-parser.h"
360diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
361index 8dfe23691b..e269856337 100644
362--- a/src/udev/net/link-config.c
363+++ b/src/udev/net/link-config.c
364@@ -1,5 +1,6 @@
365 /* SPDX-License-Identifier: LGPL-2.1-or-later */
366
367+#include <netinet/if_ether.h>
368 #include <linux/netdevice.h>
369 #include <netinet/ether.h>
370 #include <unistd.h>
371diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
372index d40251331c..89566c05f5 100644
373--- a/src/udev/udev-builtin-net_setup_link.c
374+++ b/src/udev/udev-builtin-net_setup_link.c
375@@ -1,5 +1,6 @@
376 /* SPDX-License-Identifier: LGPL-2.1-or-later */
377
378+#include <netinet/if_ether.h>
379 #include "alloc-util.h"
380 #include "device-util.h"
381 #include "errno-util.h"