From 659ad3a0af7ff0cef342db9e0388ef731c9e8987 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 12 Jul 2020 14:57:45 +0900 Subject: [PATCH] network: do not make link in configured state when no address is assigned When DHCP6 and RA are enabled, and RA does not provide any addresses, then link may become configured state even if no address is assigned, due to the time-lag between RA completion and DHCP reply. This makes if DHCP is explicitly enabled, then link must have at least one valid address to be in the configured state. --- src/network/networkd-link.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index c6fa56cc6a0..4c16255a754 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1168,6 +1168,11 @@ void link_check_ready(Link *link) { return; } + if ((link_dhcp4_enabled(link) || link_dhcp6_enabled(link)) && set_isempty(link->addresses)) { + log_link_debug(link, "%s(): DHCP4 or DHCP6 is enabled but no address is assigned yet.", __func__); + return; + } + if (link_dhcp4_enabled(link) || link_dhcp6_enabled(link) || dhcp6_get_prefix_delegation(link) || link_ipv6_accept_ra_enabled(link)) { if (!link->dhcp4_configured && !(link->dhcp6_address_configured && link->dhcp6_route_configured) && -- 2.47.3