diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/socket-util.h | 2 | ||||
-rw-r--r-- | src/libsystemd-network/arp-util.c | 3 | ||||
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-client.c | 1 | ||||
-rw-r--r-- | src/libsystemd-network/sd-ipv4acd.c | 1 | ||||
-rw-r--r-- | src/libsystemd-network/test-dhcp6-client.c | 1 | ||||
-rw-r--r-- | src/libsystemd-network/test-ipv4ll.c | 1 | ||||
-rw-r--r-- | src/network/networkd-dhcp4.c | 1 | ||||
-rw-r--r-- | src/network/networkd-dhcp6.c | 1 | ||||
-rw-r--r-- | src/network/networkd-link.c | 28 | ||||
-rw-r--r-- | src/network/networkd-lldp-rx.c | 1 | ||||
-rw-r--r-- | src/network/networkd-lldp-tx.c | 1 | ||||
-rw-r--r-- | src/systemd/sd-netlink.h | 1 |
12 files changed, 32 insertions, 10 deletions
diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index 36ec422f2c..48a22415df 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -3,9 +3,9 @@ #include <inttypes.h> #include <linux/netlink.h> +#include <linux/if_ether.h> #include <linux/if_infiniband.h> #include <linux/if_packet.h> -#include <netinet/ether.h> #include <netinet/in.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/libsystemd-network/arp-util.c b/src/libsystemd-network/arp-util.c index 3a86f3f077..ac601a4efa 100644 --- a/src/libsystemd-network/arp-util.c +++ b/src/libsystemd-network/arp-util.c @@ -3,8 +3,9 @@ Copyright © 2014 Axis Communications AB. All rights reserved. ***/ -#include <linux/filter.h> #include <arpa/inet.h> +#include <linux/filter.h> +#include <netinet/if_ether.h> #include "arp-util.h" #include "fd-util.h" diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 68b41dfb6c..d7a5349c70 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -6,6 +6,7 @@ #include <errno.h> #include <string.h> #include <sys/ioctl.h> +#include <linux/if_arp.h> #include <linux/if_infiniband.h> #include "sd-dhcp6-client.h" diff --git a/src/libsystemd-network/sd-ipv4acd.c b/src/libsystemd-network/sd-ipv4acd.c index d960027a0f..5a24f38ae9 100644 --- a/src/libsystemd-network/sd-ipv4acd.c +++ b/src/libsystemd-network/sd-ipv4acd.c @@ -5,6 +5,7 @@ #include <arpa/inet.h> #include <errno.h> +#include <netinet/if_ether.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c index 00056aa9e2..0983d7b51b 100644 --- a/src/libsystemd-network/test-dhcp6-client.c +++ b/src/libsystemd-network/test-dhcp6-client.c @@ -4,6 +4,7 @@ ***/ #include <net/ethernet.h> +#include <net/if_arp.h> #include <stdbool.h> #include <stdio.h> #include <sys/socket.h> diff --git a/src/libsystemd-network/test-ipv4ll.c b/src/libsystemd-network/test-ipv4ll.c index 2e1488cb0a..156718f209 100644 --- a/src/libsystemd-network/test-ipv4ll.c +++ b/src/libsystemd-network/test-ipv4ll.c @@ -4,6 +4,7 @@ ***/ #include <errno.h> +#include <netinet/if_ether.h> #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index f20254fc82..164e46675c 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -2,6 +2,7 @@ #include <netinet/in.h> #include <linux/if.h> +#include <linux/if_arp.h> #include "alloc-util.h" #include "hostname-util.h" diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index d6262a3885..b20aa78508 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -5,6 +5,7 @@ #include <netinet/in.h> #include <linux/if.h> +#include <linux/if_arp.h> #include "sd-radv.h" #include "sd-dhcp6-client.h" diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 17829fca9f..64e8bac7ae 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -2,6 +2,7 @@ #include <netinet/in.h> #include <linux/if.h> +#include <linux/if_arp.h> #include <unistd.h> #include "alloc-util.h" @@ -89,6 +90,13 @@ int link_sysctl_ipv6_enabled(Link *link) { return link->sysctl_ipv6_enabled; } +static bool link_is_can(Link *link) { + assert(link); + + return link->iftype == ARPHRD_CAN || + STRPTR_IN_SET(link->kind, "can", "vcan", "vxcan"); +} + static bool link_dhcp6_enabled(Link *link) { assert(link); @@ -104,7 +112,7 @@ static bool link_dhcp6_enabled(Link *link) { if (link->network->bond) return false; - if (STRPTR_IN_SET(link->kind, "can", "vcan", "vxcan")) + if (link_is_can(link)) return false; if (link_sysctl_ipv6_enabled(link) == 0) @@ -125,7 +133,7 @@ static bool link_dhcp4_enabled(Link *link) { if (link->network->bond) return false; - if (STRPTR_IN_SET(link->kind, "can", "vcan", "vxcan")) + if (link_is_can(link)) return false; return link->network->dhcp & ADDRESS_FAMILY_IPV4; @@ -143,7 +151,7 @@ static bool link_dhcp4_server_enabled(Link *link) { if (link->network->bond) return false; - if (STRPTR_IN_SET(link->kind, "can", "vcan", "vxcan")) + if (link_is_can(link)) return false; return link->network->dhcp_server; @@ -159,9 +167,12 @@ bool link_ipv4ll_enabled(Link *link, AddressFamilyBoolean mask) { if (!link->network) return false; + if (link_is_can(link)) + return false; + if (STRPTR_IN_SET(link->kind, "vrf", "wireguard", "ipip", "gre", "ip6gre","ip6tnl", "sit", "vti", - "vti6", "can", "vcan", "vxcan", "nlmon", "xfrm")) + "vti6", "nlmon", "xfrm")) return false; /* L3 or L3S mode do not support ARP. */ @@ -186,7 +197,10 @@ static bool link_ipv6ll_enabled(Link *link) { if (!link->network) return false; - if (STRPTR_IN_SET(link->kind, "vrf", "wireguard", "ipip", "gre", "sit", "vti", "can", "vcan", "vxcan", "nlmon")) + if (link_is_can(link)) + return false; + + if (STRPTR_IN_SET(link->kind, "vrf", "wireguard", "ipip", "gre", "sit", "vti", "nlmon")) return false; if (link->network->bond) @@ -210,7 +224,7 @@ static bool link_ipv6_enabled(Link *link) { if (link_sysctl_ipv6_enabled(link) == 0) return false; - if (STRPTR_IN_SET(link->kind, "can", "vcan", "vxcan")) + if (link_is_can(link)) return false; /* DHCPv6 client will not be started if no IPv6 link-local address is configured. */ @@ -2494,7 +2508,7 @@ static int link_configure(Link *link) { assert(link->network); assert(link->state == LINK_STATE_INITIALIZED); - if (STRPTR_IN_SET(link->kind, "can", "vcan", "vxcan")) + if (link_is_can(link)) return link_configure_can(link); /* Drop foreign config, but ignore loopback or critical devices. diff --git a/src/network/networkd-lldp-rx.c b/src/network/networkd-lldp-rx.c index 95018d37a3..0631cc96a0 100644 --- a/src/network/networkd-lldp-rx.c +++ b/src/network/networkd-lldp-rx.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #include <net/if.h> +#include <net/if_arp.h> #include <unistd.h> #include "fd-util.h" diff --git a/src/network/networkd-lldp-tx.c b/src/network/networkd-lldp-tx.c index 00c4358a0a..6a9e459494 100644 --- a/src/network/networkd-lldp-tx.c +++ b/src/network/networkd-lldp-tx.c @@ -3,6 +3,7 @@ #include <endian.h> #include <inttypes.h> #include <net/if.h> +#include <net/if_arp.h> #include <string.h> #include "alloc-util.h" diff --git a/src/systemd/sd-netlink.h b/src/systemd/sd-netlink.h index b0a51185e9..33cd82ba5a 100644 --- a/src/systemd/sd-netlink.h +++ b/src/systemd/sd-netlink.h @@ -19,7 +19,6 @@ #include <inttypes.h> #include <net/ethernet.h> -#include <netinet/ether.h> #include <netinet/in.h> #include <linux/neighbour.h> #include <linux/rtnetlink.h> |