1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-26 17:49:52 +03:00

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.
This commit is contained in:
Yu Watanabe
2020-07-12 14:57:45 +09:00
parent d98c546dac
commit 659ad3a0af

View File

@ -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) &&