Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | From a3be3b7160856ffb8259ede9e2e0168d74bf126e Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 26 Oct 2017 22:10:42 -0700 |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 4 | Subject: [PATCH] Include netinet/if_ether.h |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 5 | |
| 6 | Fixes |
| 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 Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 11 | and 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 | |
| 16 | The latter requires removing some includes of net/if_arp.h to avoid |
| 17 | conflicting with netinet/if_ether.h. |
| 18 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 19 | Upstream-Status: Inappropriate [musl specific] |
| 20 | |
| 21 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 22 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 23 | [rebased for systemd 243] |
| 24 | Signed-off-by: Scott Murray <scott.murray@konsulko.com> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 25 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 26 | Upstream-Status: Inappropriate [musl specific] |
| 27 | |
| 28 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 29 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
| 30 | [rebased for systemd 243] |
| 31 | Signed-off-by: Scott Murray <scott.murray@konsulko.com> |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 32 | [rebased for systemd 247] |
| 33 | Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com> |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 34 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 35 | --- |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 36 | 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 Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 60 | |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 61 | diff --git a/src/basic/linux/in6.h b/src/basic/linux/in6.h |
| 62 | index 5ad396a57e..1dc007fe13 100644 |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 63 | --- 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 Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 105 | diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 106 | index efbf7d7df3..86906332b6 100644 |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 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" |
| 117 | diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c |
| 118 | index 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> |
| 129 | diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c |
| 130 | index 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 |
| 141 | diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c |
| 142 | index 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" |
| 152 | diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c |
| 153 | index 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" |
| 163 | diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c |
| 164 | index 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> |
| 174 | diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf |
| 175 | index 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" |
| 186 | diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c |
| 187 | index 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> |
| 197 | diff --git a/src/network/networkd-bridge-vlan.c b/src/network/networkd-bridge-vlan.c |
| 198 | index 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 | |
| 209 | diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c |
| 210 | index 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" |
| 231 | diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c |
| 232 | index 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 | |
| 246 | diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c |
| 247 | index 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" |
| 261 | diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c |
| 262 | index 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 | |
| 276 | diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 277 | index 20675f2306..2884511ff3 100644 |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 278 | --- a/src/network/networkd-link.c |
| 279 | +++ b/src/network/networkd-link.c |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 280 | @@ -1,9 +1,9 @@ |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 281 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 282 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 283 | #include <net/if.h> |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 284 | +#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> |
| 291 | diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c |
| 292 | index 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> |
| 302 | diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 303 | index eeba31c45d..0a2b0ed42b 100644 |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 304 | --- 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 Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 313 | diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 314 | index 13c4cedd10..6558d551ab 100644 |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 315 | --- 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 Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 327 | diff --git a/src/network/test-network-tables.c b/src/network/test-network-tables.c |
| 328 | index 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" |
| 338 | diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c |
| 339 | index 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> |
| 349 | diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h |
| 350 | index 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" |
| 361 | diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c |
| 362 | index 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> |
| 372 | diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 373 | index 5964e30bf1..52a18d7a7f 100644 |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 374 | --- 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" |