From 463797c1044cab1f13347cdd4e880d6b40880adc Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 14 Jun 2019 05:16:11 +0900 Subject: [PATCH] network: skip to check dynamic addresses when ConfigureWithoutCarrier=yes Otherwise, the interface cannot be in "configured" state, as ipv6 link local addressing is enabled by default. Note that even if ConfigureWithoutCarrier= is set, all dynamic configurations are checked when the interface has carrier. --- src/network/networkd-link.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 0c243508a43..115e26e307c 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -960,23 +960,26 @@ void link_check_ready(Link *link) { if (!link->routing_policy_rules_configured) return; - if (link_ipv4ll_enabled(link, ADDRESS_FAMILY_IPV4) && !(link->ipv4ll_address && link->ipv4ll_route)) - return; + if (link_has_carrier(link) || !link->network->configure_without_carrier) { - if (link_ipv6ll_enabled(link) && - in_addr_is_null(AF_INET6, (const union in_addr_union*) &link->ipv6ll_address)) - return; + if (link_ipv4ll_enabled(link, ADDRESS_FAMILY_IPV4) && !(link->ipv4ll_address && link->ipv4ll_route)) + return; - if ((link_dhcp4_enabled(link) || link_dhcp6_enabled(link)) && - !link->dhcp4_configured && - !link->dhcp6_configured && - !(link_ipv4ll_enabled(link, ADDRESS_FAMILY_FALLBACK_IPV4) && link->ipv4ll_address && link->ipv4ll_route)) - /* When DHCP is enabled, at least one protocol must provide an address, or - * an IPv4ll fallback address must be configured. */ - return; + if (link_ipv6ll_enabled(link) && + in_addr_is_null(AF_INET6, (const union in_addr_union*) &link->ipv6ll_address)) + return; - if (link_ipv6_accept_ra_enabled(link) && !link->ndisc_configured) - return; + if ((link_dhcp4_enabled(link) || link_dhcp6_enabled(link)) && + !link->dhcp4_configured && + !link->dhcp6_configured && + !(link_ipv4ll_enabled(link, ADDRESS_FAMILY_FALLBACK_IPV4) && link->ipv4ll_address && link->ipv4ll_route)) + /* When DHCP is enabled, at least one protocol must provide an address, or + * an IPv4ll fallback address must be configured. */ + return; + + if (link_ipv6_accept_ra_enabled(link) && !link->ndisc_configured) + return; + } if (link->state != LINK_STATE_CONFIGURED) link_enter_configured(link);