summaryrefslogtreecommitdiff
path: root/src/network/networkd-dhcp4.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-01-31 12:08:24 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-01-31 13:10:28 +0900
commitf42d41cc5f9cd8cac538a1c30fda04d346b5bae2 (patch)
treec63662b0e3eefe321d575d3666f223554e8cfefc /src/network/networkd-dhcp4.c
parentbbe53713455be38c0a587626439fd171f28c77fc (diff)
downloadsystemd-f42d41cc5f9cd8cac538a1c30fda04d346b5bae2.tar.gz
network: configure DHCP clients after MAC address is assigned
Prompted by #20090.
Diffstat (limited to 'src/network/networkd-dhcp4.c')
-rw-r--r--src/network/networkd-dhcp4.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index cb9c428ae9..718ac62f8e 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -1607,6 +1607,11 @@ int request_process_dhcp4_client(Request *req) {
if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
return 0;
+ if (!IN_SET(link->hw_addr.length, ETH_ALEN, INFINIBAND_ALEN) ||
+ hw_addr_is_null(&link->hw_addr))
+ /* No MAC address is assigned to the hardware, or non-supported MAC address length. */
+ return 0;
+
r = dhcp4_configure_duid(link);
if (r <= 0)
return r;