summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-01-31 13:07:34 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-01-31 13:10:28 +0900
commitc565b655535b4e3242df14352f4c5db57abd2627 (patch)
tree68cfbb21167dec3b85689f0ed35fb7579bb9a2d5 /src/network
parent218a850268ca7839d1eecdc47fc6d602931e1e4f (diff)
downloadsystemd-c565b655535b4e3242df14352f4c5db57abd2627.tar.gz
network: currently IPv4ACD requires MAC address whose length is ETH_ALEN
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-ipv4acd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/networkd-ipv4acd.c b/src/network/networkd-ipv4acd.c
index 703278f8b8..009cde27de 100644
--- a/src/network/networkd-ipv4acd.c
+++ b/src/network/networkd-ipv4acd.c
@@ -132,7 +132,8 @@ int ipv4acd_configure(Address *address) {
int r;
assert(address);
- assert(address->link);
+
+ link = ASSERT_PTR(address->link);
if (address->family != AF_INET)
return 0;
@@ -140,6 +141,9 @@ int ipv4acd_configure(Address *address) {
if (!FLAGS_SET(address->duplicate_address_detection, ADDRESS_FAMILY_IPV4))
return 0;
+ if (link->hw_addr.length != ETH_ALEN || hw_addr_is_null(&link->hw_addr))
+ return 0;
+
/* Currently, only static and DHCP4 addresses are supported. */
assert(IN_SET(address->source, NETWORK_CONFIG_SOURCE_STATIC, NETWORK_CONFIG_SOURCE_DHCP4));
@@ -148,8 +152,6 @@ int ipv4acd_configure(Address *address) {
return 0;
}
- link = address->link;
-
log_link_debug(link, "Configuring IPv4ACD for address "IPV4_ADDRESS_FMT_STR,
IPV4_ADDRESS_FMT_VAL(address->in_addr.in));