blob: 9142d7b45c8d71e5512e0267afdb53d6e714287d [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001From 47818052121d135632f5e46c369e3e4706a0f9e0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 26 Oct 2017 22:10:42 -0700
4Subject: [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 Geissler82c905d2020-04-13 13:39:40 -050032
Brad Bishopa34c0302019-09-23 22:34:48 -040033---
34 src/libsystemd-network/sd-dhcp6-client.c | 1 -
35 src/libsystemd/sd-netlink/netlink-types.c | 1 +
36 src/machine/machine-dbus.c | 1 +
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 src/network/netdev/bond.c | 1 +
38 src/network/netdev/bridge.c | 1 +
Brad Bishopa34c0302019-09-23 22:34:48 -040039 src/network/netdev/macsec.c | 1 +
Andrew Geissler82c905d2020-04-13 13:39:40 -050040 src/network/netdev/netdev-gperf.gperf | 1 +
Brad Bishopa34c0302019-09-23 22:34:48 -040041 src/network/netdev/netdev.c | 1 +
42 src/network/networkd-brvlan.c | 1 +
43 src/network/networkd-dhcp-common.c | 1 +
44 src/network/networkd-dhcp4.c | 2 +-
45 src/network/networkd-dhcp6.c | 2 +-
46 src/network/networkd-link.c | 2 +-
47 src/network/networkd-network.c | 1 +
Andrew Geissler82c905d2020-04-13 13:39:40 -050048 src/network/test-network-tables.c | 1 +
Brad Bishopa34c0302019-09-23 22:34:48 -040049 src/shared/ethtool-util.c | 1 +
50 src/shared/ethtool-util.h | 1 +
51 src/udev/net/link-config.c | 1 +
52 src/udev/udev-builtin-net_setup_link.c | 1 +
Andrew Geissler82c905d2020-04-13 13:39:40 -050053 19 files changed, 18 insertions(+), 4 deletions(-)
Brad Bishopa34c0302019-09-23 22:34:48 -040054
55diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
Andrew Geissler82c905d2020-04-13 13:39:40 -050056index eac2e725cce7..1beae7ba91cc 100644
Brad Bishopa34c0302019-09-23 22:34:48 -040057--- a/src/libsystemd-network/sd-dhcp6-client.c
58+++ b/src/libsystemd-network/sd-dhcp6-client.c
Andrew Geissler82c905d2020-04-13 13:39:40 -050059@@ -5,7 +5,6 @@
60
Brad Bishopa34c0302019-09-23 22:34:48 -040061 #include <errno.h>
Brad Bishopa34c0302019-09-23 22:34:48 -040062 #include <sys/ioctl.h>
63-#include <linux/if_arp.h>
64 #include <linux/if_infiniband.h>
65
66 #include "sd-dhcp6-client.h"
Brad Bishop19323692019-04-05 15:28:33 -040067diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
Andrew Geissler82c905d2020-04-13 13:39:40 -050068index e35127a4cd2e..4f6ad9ef5886 100644
Brad Bishop19323692019-04-05 15:28:33 -040069--- a/src/libsystemd/sd-netlink/netlink-types.c
70+++ b/src/libsystemd/sd-netlink/netlink-types.c
71@@ -3,6 +3,7 @@
72 #include <netinet/in.h>
73 #include <stdint.h>
74 #include <sys/socket.h>
75+#include <netinet/if_ether.h>
Brad Bishopa34c0302019-09-23 22:34:48 -040076 #include <linux/can/vxcan.h>
Brad Bishop19323692019-04-05 15:28:33 -040077 #include <linux/netlink.h>
78 #include <linux/rtnetlink.h>
Brad Bishopa34c0302019-09-23 22:34:48 -040079diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
Andrew Geissler82c905d2020-04-13 13:39:40 -050080index a2990452af17..5af350883c28 100644
Brad Bishopa34c0302019-09-23 22:34:48 -040081--- a/src/machine/machine-dbus.c
82+++ b/src/machine/machine-dbus.c
Andrew Geissler82c905d2020-04-13 13:39:40 -050083@@ -3,6 +3,7 @@
84 #include <errno.h>
Brad Bishopa34c0302019-09-23 22:34:48 -040085 #include <sys/mount.h>
86 #include <sys/wait.h>
Brad Bishop19323692019-04-05 15:28:33 -040087+#include <netinet/if_ether.h>
Brad Bishopa34c0302019-09-23 22:34:48 -040088
89 /* When we include libgen.h because we need dirname() we immediately
90 * undefine basename() since libgen.h defines it as a macro to the POSIX
Andrew Geissler82c905d2020-04-13 13:39:40 -050091diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c
92index 8df39e35843f..8d697894f970 100644
93--- a/src/network/netdev/bond.c
94+++ b/src/network/netdev/bond.c
95@@ -1,5 +1,6 @@
96 /* SPDX-License-Identifier: LGPL-2.1+ */
97
98+#include <netinet/if_ether.h>
99 #include "alloc-util.h"
100 #include "bond.h"
101 #include "conf-parser.h"
102diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c
103index 6b8f9944612e..7f81ec25c407 100644
104--- a/src/network/netdev/bridge.c
105+++ b/src/network/netdev/bridge.c
106@@ -1,5 +1,6 @@
107 /* SPDX-License-Identifier: LGPL-2.1+ */
108
109+#include <netinet/if_ether.h>
110 #include <net/if.h>
111
112 #include "bridge.h"
Brad Bishopa34c0302019-09-23 22:34:48 -0400113diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500114index 7d1fec3afe6d..e948a335336d 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400115--- a/src/network/netdev/macsec.c
116+++ b/src/network/netdev/macsec.c
117@@ -1,5 +1,6 @@
118 /* SPDX-License-Identifier: LGPL-2.1+ */
119
120+#include <netinet/if_ether.h>
121 #include <netinet/in.h>
122 #include <linux/if_ether.h>
123 #include <linux/if_macsec.h>
Andrew Geissler82c905d2020-04-13 13:39:40 -0500124diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf
125index 09a5f4822e03..873299b1f98a 100644
126--- a/src/network/netdev/netdev-gperf.gperf
127+++ b/src/network/netdev/netdev-gperf.gperf
128@@ -2,6 +2,7 @@
129 #if __GNUC__ >= 7
130 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
131 #endif
132+#include <netinet/if_ether.h>
133 #include <stddef.h>
134 #include "bond.h"
135 #include "bridge.h"
Brad Bishopa34c0302019-09-23 22:34:48 -0400136diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500137index f8121a48ed92..437f411c61e8 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400138--- a/src/network/netdev/netdev.c
139+++ b/src/network/netdev/netdev.c
140@@ -1,5 +1,6 @@
141 /* SPDX-License-Identifier: LGPL-2.1+ */
142
143+#include <netinet/if_ether.h>
Brad Bishop19323692019-04-05 15:28:33 -0400144 #include <net/if.h>
Brad Bishopa34c0302019-09-23 22:34:48 -0400145 #include <netinet/in.h>
146
Brad Bishop19323692019-04-05 15:28:33 -0400147diff --git a/src/network/networkd-brvlan.c b/src/network/networkd-brvlan.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500148index 41f09287f2b7..b67ce4fc8844 100644
Brad Bishop19323692019-04-05 15:28:33 -0400149--- a/src/network/networkd-brvlan.c
150+++ b/src/network/networkd-brvlan.c
151@@ -4,6 +4,7 @@
152 ***/
153
154 #include <netinet/in.h>
155+#include <netinet/if_ether.h>
156 #include <linux/if_bridge.h>
157 #include <stdbool.h>
158
Brad Bishopa34c0302019-09-23 22:34:48 -0400159diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500160index 8664d8cdc0d4..e9f91f74c1a1 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400161--- a/src/network/networkd-dhcp-common.c
162+++ b/src/network/networkd-dhcp-common.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500163@@ -4,6 +4,7 @@
164 #include "escape.h"
165 #include "in-addr-util.h"
Brad Bishopa34c0302019-09-23 22:34:48 -0400166 #include "networkd-dhcp-common.h"
167+#include <netinet/if_ether.h>
168 #include "networkd-network.h"
169 #include "parse-util.h"
170 #include "string-table.h"
171diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500172index 13e3e32f40e8..5394399c9150 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400173--- a/src/network/networkd-dhcp4.c
174+++ b/src/network/networkd-dhcp4.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500175@@ -1,9 +1,9 @@
Brad Bishopa34c0302019-09-23 22:34:48 -0400176 /* SPDX-License-Identifier: LGPL-2.1+ */
177
178+#include <netinet/if_ether.h>
179 #include <netinet/in.h>
Andrew Geissler82c905d2020-04-13 13:39:40 -0500180 #include <netinet/ip.h>
Brad Bishopa34c0302019-09-23 22:34:48 -0400181 #include <linux/if.h>
182-#include <linux/if_arp.h>
183
184 #include "alloc-util.h"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500185 #include "dhcp-client-internal.h"
Brad Bishopa34c0302019-09-23 22:34:48 -0400186diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500187index 7304270c60b1..099064f64715 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400188--- a/src/network/networkd-dhcp6.c
189+++ b/src/network/networkd-dhcp6.c
190@@ -3,9 +3,9 @@
191 Copyright © 2014 Intel Corporation. All rights reserved.
192 ***/
193
194+#include <netinet/if_ether.h>
195 #include <netinet/in.h>
196 #include <linux/if.h>
197-#include <linux/if_arp.h>
198 #include "sd-radv.h"
199
200 #include "sd-dhcp6-client.h"
201diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500202index 99d4b29c31ec..e8b467d6ac09 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400203--- a/src/network/networkd-link.c
204+++ b/src/network/networkd-link.c
205@@ -1,8 +1,8 @@
206 /* SPDX-License-Identifier: LGPL-2.1+ */
207
208+#include <netinet/if_ether.h>
209 #include <netinet/in.h>
210 #include <linux/if.h>
211-#include <linux/if_arp.h>
212 #include <unistd.h>
213
214 #include "alloc-util.h"
215diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500216index 2e716b291e97..56f18cea57fe 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400217--- a/src/network/networkd-network.c
218+++ b/src/network/networkd-network.c
219@@ -1,5 +1,6 @@
220 /* SPDX-License-Identifier: LGPL-2.1+ */
221
222+#include <netinet/if_ether.h>
223 #include <net/if.h>
224 #include <netinet/in.h>
225 #include <linux/netdevice.h>
Andrew Geissler82c905d2020-04-13 13:39:40 -0500226diff --git a/src/network/test-network-tables.c b/src/network/test-network-tables.c
227index 25b939639775..530e4928835c 100644
228--- a/src/network/test-network-tables.c
229+++ b/src/network/test-network-tables.c
230@@ -1,3 +1,4 @@
231+#include <netinet/if_ether.h>
232 #include "bond.h"
233 #include "dhcp6-internal.h"
234 #include "dhcp6-protocol.h"
Brad Bishopa34c0302019-09-23 22:34:48 -0400235diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500236index 00a71d64a638..4593e89120b8 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400237--- a/src/shared/ethtool-util.c
238+++ b/src/shared/ethtool-util.c
Brad Bishop19323692019-04-05 15:28:33 -0400239@@ -1,5 +1,6 @@
240 /* SPDX-License-Identifier: LGPL-2.1+ */
241
242+#include <netinet/if_ether.h>
243 #include <net/if.h>
244 #include <sys/ioctl.h>
245 #include <linux/ethtool.h>
Brad Bishopa34c0302019-09-23 22:34:48 -0400246diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h
Andrew Geissler82c905d2020-04-13 13:39:40 -0500247index c1d5d7590ef9..b3e018bf76e9 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400248--- a/src/shared/ethtool-util.h
249+++ b/src/shared/ethtool-util.h
Andrew Geissler82c905d2020-04-13 13:39:40 -0500250@@ -3,6 +3,7 @@
Brad Bishop19323692019-04-05 15:28:33 -0400251
252 #include <macro.h>
Andrew Geissler82c905d2020-04-13 13:39:40 -0500253 #include <net/ethernet.h>
Brad Bishop19323692019-04-05 15:28:33 -0400254+#include <netinet/if_ether.h>
255 #include <linux/ethtool.h>
256
257 #include "conf-parser.h"
Brad Bishopa34c0302019-09-23 22:34:48 -0400258diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500259index 0332e99269c9..ff3aead4a779 100644
Brad Bishopa34c0302019-09-23 22:34:48 -0400260--- a/src/udev/net/link-config.c
261+++ b/src/udev/net/link-config.c
262@@ -1,5 +1,6 @@
263 /* SPDX-License-Identifier: LGPL-2.1+ */
264
265+#include <netinet/if_ether.h>
266 #include <linux/netdevice.h>
267 #include <netinet/ether.h>
268
Brad Bishop19323692019-04-05 15:28:33 -0400269diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
Andrew Geissler82c905d2020-04-13 13:39:40 -0500270index ee3ca9fa3846..9aa4e828741f 100644
Brad Bishop19323692019-04-05 15:28:33 -0400271--- a/src/udev/udev-builtin-net_setup_link.c
272+++ b/src/udev/udev-builtin-net_setup_link.c
273@@ -1,5 +1,6 @@
274 /* SPDX-License-Identifier: LGPL-2.1+ */
275
276+#include <netinet/if_ether.h>
277 #include "device-util.h"
278 #include "alloc-util.h"
279 #include "link-config.h"