From b4054aff24b326e36008e6174b5737e0917405c1 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 17 Feb 2024 04:30:34 +0900 Subject: [PATCH] network: do not request DHCP addresses configured on checking prefix delegation This does not change anything for DHCPv4, as a DHCPv4 address is always requested anyway. However for DHCPv6, the client may not request IA_NA addresses by UseAddress=no, or even if it is requested, the server may not provide any IA_NA addresses. Even in such cases, here the check is for delegated prefixes, hence it is not necessary to check if DHCPv6 IA_NA addresses are configured. Fixes a bug introduced by 195b83edf852f4e40e0d3a3b630cde97c84d77ba. Fixes #31349. --- src/network/networkd-link.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 566d251b153..95391017024 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -567,7 +567,7 @@ void link_check_ready(Link *link) { if (dhcp_pd_is_uplink(link, link, /* accept_auto = */ false)) { if (link_dhcp4_enabled(link) && link->network->dhcp_use_6rd && sd_dhcp_lease_has_6rd(link->dhcp_lease)) { - if (!dhcp4_ready) + if (!link->dhcp4_configured) return (void) log_link_debug(link, "%s(): DHCPv4 6rd prefix is assigned, but DHCPv4 protocol is not finished yet.", __func__); if (!dhcp_pd_ready) return (void) log_link_debug(link, "%s(): DHCPv4 is finished, but prefix acquired by DHCPv4-6rd is not assigned yet.", __func__); @@ -575,7 +575,7 @@ void link_check_ready(Link *link) { if (link_dhcp6_enabled(link) && link->network->dhcp6_use_pd_prefix && sd_dhcp6_lease_has_pd_prefix(link->dhcp6_lease)) { - if (!dhcp6_ready) + if (!link->dhcp6_configured) return (void) log_link_debug(link, "%s(): DHCPv6 IA_PD prefix is assigned, but DHCPv6 protocol is not finished yet.", __func__); if (!dhcp_pd_ready) return (void) log_link_debug(link, "%s(): DHCPv6 is finished, but prefix acquired by DHCPv6 IA_PD is not assigned yet.", __func__); -- 2.47.3