From 5da745dc6f60f6fac65371a60eee7cecaf575eae Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 21 Jan 2022 22:19:37 -0800
Subject: [PATCH] Adjust for musl headers

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Khem Raj <raj.khem@gmail.com>

[Rebased for v255.1]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 src/libsystemd-network/sd-dhcp6-client.c      | 2 +-
 src/network/netdev/bareudp.c                  | 2 +-
 src/network/netdev/batadv.c                   | 2 +-
 src/network/netdev/bond.c                     | 2 +-
 src/network/netdev/bridge.c                   | 2 +-
 src/network/netdev/dummy.c                    | 2 +-
 src/network/netdev/geneve.c                   | 2 +-
 src/network/netdev/ifb.c                      | 2 +-
 src/network/netdev/ipoib.c                    | 2 +-
 src/network/netdev/ipvlan.c                   | 2 +-
 src/network/netdev/macsec.c                   | 2 +-
 src/network/netdev/macvlan.c                  | 2 +-
 src/network/netdev/netdev.c                   | 2 +-
 src/network/netdev/netdevsim.c                | 2 +-
 src/network/netdev/nlmon.c                    | 2 +-
 src/network/netdev/tunnel.c                   | 2 +-
 src/network/netdev/vcan.c                     | 2 +-
 src/network/netdev/veth.c                     | 2 +-
 src/network/netdev/vlan.c                     | 2 +-
 src/network/netdev/vrf.c                      | 2 +-
 src/network/netdev/vxcan.c                    | 2 +-
 src/network/netdev/vxlan.c                    | 2 +-
 src/network/netdev/wireguard.c                | 2 +-
 src/network/netdev/xfrm.c                     | 2 +-
 src/network/networkd-bridge-mdb.c             | 4 ++--
 src/network/networkd-dhcp-common.c            | 3 ++-
 src/network/networkd-dhcp-prefix-delegation.c | 3 ++-
 src/network/networkd-dhcp-server.c            | 2 +-
 src/network/networkd-dhcp4.c                  | 2 +-
 src/network/networkd-ipv6ll.c                 | 2 +-
 src/network/networkd-link.c                   | 2 +-
 src/network/networkd-ndisc.c                  | 2 +-
 src/network/networkd-route.c                  | 8 ++++----
 src/network/networkd-setlink.c                | 2 +-
 src/network/networkd-sysctl.c                 | 2 +-
 src/shared/linux/ethtool.h                    | 3 ++-
 src/shared/netif-util.c                       | 2 +-
 src/udev/udev-builtin-net_id.c                | 2 +-
 38 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index c20367dfc9..b8d4cd8c2a 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -5,7 +5,7 @@
 
 #include <errno.h>
 #include <sys/ioctl.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/if_infiniband.h>
 
 #include "sd-dhcp6-client.h"
diff --git a/src/network/netdev/bareudp.c b/src/network/netdev/bareudp.c
index 1df886573b..c8b6714726 100644
--- a/src/network/netdev/bareudp.c
+++ b/src/network/netdev/bareudp.c
@@ -2,7 +2,7 @@
  * Copyright © 2020 VMware, Inc. */
 
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "bareudp.h"
 #include "netlink-util.h"
diff --git a/src/network/netdev/batadv.c b/src/network/netdev/batadv.c
index 26da0231d4..2e8002af8c 100644
--- a/src/network/netdev/batadv.c
+++ b/src/network/netdev/batadv.c
@@ -3,7 +3,7 @@
 #include <inttypes.h>
 #include <netinet/in.h>
 #include <linux/genetlink.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "batadv.h"
 #include "fileio.h"
diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c
index 4d75a0d6bf..985b3197e0 100644
--- a/src/network/netdev/bond.c
+++ b/src/network/netdev/bond.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "alloc-util.h"
 #include "bond.h"
diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c
index 3e394edadf..f12f667687 100644
--- a/src/network/netdev/bridge.c
+++ b/src/network/netdev/bridge.c
@@ -2,7 +2,7 @@
 
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/if_bridge.h>
 
 #include "bridge.h"
diff --git a/src/network/netdev/dummy.c b/src/network/netdev/dummy.c
index 00df1d2787..77b506b422 100644
--- a/src/network/netdev/dummy.c
+++ b/src/network/netdev/dummy.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "dummy.h"
 
diff --git a/src/network/netdev/geneve.c b/src/network/netdev/geneve.c
index bc655ec7ff..a77e8e17e4 100644
--- a/src/network/netdev/geneve.c
+++ b/src/network/netdev/geneve.c
@@ -2,7 +2,7 @@
 
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "alloc-util.h"
 #include "conf-parser.h"
diff --git a/src/network/netdev/ifb.c b/src/network/netdev/ifb.c
index d7ff44cb9e..e037629ae4 100644
--- a/src/network/netdev/ifb.c
+++ b/src/network/netdev/ifb.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later
  * Copyright © 2019 VMware, Inc. */
 
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "ifb.h"
 
diff --git a/src/network/netdev/ipoib.c b/src/network/netdev/ipoib.c
index d5fe299b7b..c9c8002eac 100644
--- a/src/network/netdev/ipoib.c
+++ b/src/network/netdev/ipoib.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/if_link.h>
 
 #include "ipoib.h"
diff --git a/src/network/netdev/ipvlan.c b/src/network/netdev/ipvlan.c
index 05d5d010f6..d440f49537 100644
--- a/src/network/netdev/ipvlan.c
+++ b/src/network/netdev/ipvlan.c
@@ -2,7 +2,7 @@
 
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "conf-parser.h"
 #include "ipvlan.h"
diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c
index 17d6acefb6..679d0984f9 100644
--- a/src/network/netdev/macsec.c
+++ b/src/network/netdev/macsec.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/if_ether.h>
 #include <linux/if_macsec.h>
 #include <linux/genetlink.h>
diff --git a/src/network/netdev/macvlan.c b/src/network/netdev/macvlan.c
index 203807e3a5..8ab09a387e 100644
--- a/src/network/netdev/macvlan.c
+++ b/src/network/netdev/macvlan.c
@@ -2,7 +2,7 @@
 
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "conf-parser.h"
 #include "macvlan.h"
diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c
index 57127a861a..7f787d0b9f 100644
--- a/src/network/netdev/netdev.c
+++ b/src/network/netdev/netdev.c
@@ -2,7 +2,7 @@
 
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
diff --git a/src/network/netdev/netdevsim.c b/src/network/netdev/netdevsim.c
index 15d5c132f9..a3ffa48b15 100644
--- a/src/network/netdev/netdevsim.c
+++ b/src/network/netdev/netdevsim.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "netdevsim.h"
 
diff --git a/src/network/netdev/nlmon.c b/src/network/netdev/nlmon.c
index ff372092e6..eef66811f4 100644
--- a/src/network/netdev/nlmon.c
+++ b/src/network/netdev/nlmon.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "nlmon.h"
 
diff --git a/src/network/netdev/tunnel.c b/src/network/netdev/tunnel.c
index ab3b8fbb51..68f88b3ca3 100644
--- a/src/network/netdev/tunnel.c
+++ b/src/network/netdev/tunnel.c
@@ -2,7 +2,7 @@
 
 #include <netinet/in.h>
 #include <linux/fou.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/if_tunnel.h>
 #include <linux/ip.h>
 #include <linux/ip6_tunnel.h>
diff --git a/src/network/netdev/vcan.c b/src/network/netdev/vcan.c
index 380547ee1e..137c1adf8a 100644
--- a/src/network/netdev/vcan.c
+++ b/src/network/netdev/vcan.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "vcan.h"
 
diff --git a/src/network/netdev/veth.c b/src/network/netdev/veth.c
index e0f5b4ebb1..8a424ed03d 100644
--- a/src/network/netdev/veth.c
+++ b/src/network/netdev/veth.c
@@ -3,7 +3,7 @@
 #include <errno.h>
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/veth.h>
 
 #include "netlink-util.h"
diff --git a/src/network/netdev/vlan.c b/src/network/netdev/vlan.c
index 2390206993..efec630e30 100644
--- a/src/network/netdev/vlan.c
+++ b/src/network/netdev/vlan.c
@@ -2,7 +2,7 @@
 
 #include <errno.h>
 #include <net/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/if_vlan.h>
 
 #include "parse-util.h"
diff --git a/src/network/netdev/vrf.c b/src/network/netdev/vrf.c
index b75ec2bcc6..6aeeea640b 100644
--- a/src/network/netdev/vrf.c
+++ b/src/network/netdev/vrf.c
@@ -2,7 +2,7 @@
 
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "vrf.h"
 
diff --git a/src/network/netdev/vxcan.c b/src/network/netdev/vxcan.c
index c0343f45b6..f9e718f40b 100644
--- a/src/network/netdev/vxcan.c
+++ b/src/network/netdev/vxcan.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <linux/can/vxcan.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "vxcan.h"
 
diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c
index b11fdbbd0d..a971a917f0 100644
--- a/src/network/netdev/vxlan.c
+++ b/src/network/netdev/vxlan.c
@@ -2,7 +2,7 @@
 
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "conf-parser.h"
 #include "alloc-util.h"
diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c
index 52fed20b57..e66bc34993 100644
--- a/src/network/netdev/wireguard.c
+++ b/src/network/netdev/wireguard.c
@@ -6,7 +6,7 @@
 #include <sys/ioctl.h>
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/ipv6_route.h>
 
 #include "sd-resolve.h"
diff --git a/src/network/netdev/xfrm.c b/src/network/netdev/xfrm.c
index 905bfc0bdf..39e34dbb3b 100644
--- a/src/network/netdev/xfrm.c
+++ b/src/network/netdev/xfrm.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "missing_network.h"
 #include "xfrm.h"
diff --git a/src/network/networkd-bridge-mdb.c b/src/network/networkd-bridge-mdb.c
index bd1a9745dc..949d3da029 100644
--- a/src/network/networkd-bridge-mdb.c
+++ b/src/network/networkd-bridge-mdb.c
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <net/if.h>
-#include <linux/if_bridge.h>
 
 #include "netlink-util.h"
 #include "networkd-bridge-mdb.h"
@@ -11,6 +9,8 @@
 #include "networkd-queue.h"
 #include "string-util.h"
 #include "vlan-util.h"
+#include <net/if.h>
+#include <linux/if_bridge.h>
 
 #define STATIC_BRIDGE_MDB_ENTRIES_PER_NETWORK_MAX 1024U
 
diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c
index 080b15387c..efe8283957 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 <linux/if_arp.h>
+#include <net/if.h>
 
 #include "bus-error.h"
 #include "bus-locator.h"
diff --git a/src/network/networkd-dhcp-prefix-delegation.c b/src/network/networkd-dhcp-prefix-delegation.c
index af2fe9efcd..511565700f 100644
--- a/src/network/networkd-dhcp-prefix-delegation.c
+++ b/src/network/networkd-dhcp-prefix-delegation.c
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <linux/ipv6_route.h>
 
 #include "dhcp6-lease-internal.h"
 #include "hashmap.h"
@@ -20,6 +19,8 @@
 #include "strv.h"
 #include "tunnel.h"
 
+#include <linux/ipv6_route.h>
+
 bool link_dhcp_pd_is_enabled(Link *link) {
         assert(link);
 
diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c
index 607fe0053c..9ce4005874 100644
--- a/src/network/networkd-dhcp-server.c
+++ b/src/network/networkd-dhcp-server.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/if.h>
 
 #include "sd-dhcp-server.h"
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index 8945827862..7571429523 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -3,7 +3,7 @@
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "alloc-util.h"
 #include "dhcp-client-internal.h"
diff --git a/src/network/networkd-ipv6ll.c b/src/network/networkd-ipv6ll.c
index 32229a3fc7..662a345d6e 100644
--- a/src/network/networkd-ipv6ll.c
+++ b/src/network/networkd-ipv6ll.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "in-addr-util.h"
 #include "networkd-address.h"
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index a4fa321264..0fd81a53d1 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -3,7 +3,7 @@
 #include <net/if.h>
 #include <netinet/in.h>
 #include <linux/if.h>
-#include <linux/if_arp.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-ndisc.c b/src/network/networkd-ndisc.c
index 840ccb158d..9f2e85e32f 100644
--- a/src/network/networkd-ndisc.c
+++ b/src/network/networkd-ndisc.c
@@ -6,7 +6,7 @@
 #include <arpa/inet.h>
 #include <netinet/icmp6.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "sd-ndisc.h"
 
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index eb502ae2cf..5b25ee4523 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <linux/icmpv6.h>
-#include <linux/ipv6_route.h>
-#include <linux/nexthop.h>
-
 #include "alloc-util.h"
 #include "event-util.h"
 #include "netlink-util.h"
@@ -21,6 +17,10 @@
 #include "vrf.h"
 #include "wireguard.h"
 
+#include <linux/icmpv6.h>
+#include <linux/ipv6_route.h>
+#include <linux/nexthop.h>
+
 int route_new(Route **ret) {
         _cleanup_(route_freep) Route *route = NULL;
 
diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c
index 011ea1fe6e..59dfe733eb 100644
--- a/src/network/networkd-setlink.c
+++ b/src/network/networkd-setlink.c
@@ -2,7 +2,7 @@
 
 #include <netinet/in.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/if_bridge.h>
 
 #include "missing_network.h"
diff --git a/src/network/networkd-sysctl.c b/src/network/networkd-sysctl.c
index 2b226b2e2a..f12a474e2f 100644
--- a/src/network/networkd-sysctl.c
+++ b/src/network/networkd-sysctl.c
@@ -2,7 +2,7 @@
 
 #include <netinet/in.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "missing_network.h"
 #include "networkd-link.h"
diff --git a/src/shared/linux/ethtool.h b/src/shared/linux/ethtool.h
index 3d1da515c0..3fca9a4faf 100644
--- a/src/shared/linux/ethtool.h
+++ b/src/shared/linux/ethtool.h
@@ -16,7 +16,8 @@
 
 #include <linux/const.h>
 #include <linux/types.h>
-#include <linux/if_ether.h>
+#include <netinet/if_ether.h>
+//#include <linux/if_ether.h>
 
 #include <limits.h> /* for INT_MAX */
 
diff --git a/src/shared/netif-util.c b/src/shared/netif-util.c
index f56c5646c1..5af28ff119 100644
--- a/src/shared/netif-util.c
+++ b/src/shared/netif-util.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "arphrd-util.h"
 #include "device-util.h"
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index f528a46b8e..830318cda5 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -18,7 +18,7 @@
 #include <stdarg.h>
 #include <unistd.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/netdevice.h>
 #include <linux/pci_regs.h>
 
