From: Yu Watanabe Date: Fri, 3 May 2019 23:36:51 +0000 (+0200) Subject: network: rewrite condition about DHCP in link_check_ready() X-Git-Tag: v243-rc1~488^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=552081a4992e2d17a769c65b991c8f41b9802c12;p=thirdparty%2Fsystemd.git network: rewrite condition about DHCP in link_check_ready() --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 695c9e4bafa..52577f52693 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1021,12 +1021,9 @@ void link_check_ready(Link *link) { in_addr_is_null(AF_INET6, (const union in_addr_union*) &link->ipv6ll_address)) return; - if ((link_dhcp4_enabled(link) && !link_dhcp6_enabled(link) && - !link->dhcp4_configured) || - (link_dhcp6_enabled(link) && !link_dhcp4_enabled(link) && - !link->dhcp6_configured) || - (link_dhcp4_enabled(link) && link_dhcp6_enabled(link) && - !link->dhcp4_configured && !link->dhcp6_configured)) + if ((link_dhcp4_enabled(link) || link_dhcp6_enabled(link)) && + !(link->dhcp4_configured || link->dhcp6_configured)) + /* When DHCP is enabled, at least one protocol must provide an address. */ return; if (link_ipv6_accept_ra_enabled(link) && !link->ndisc_configured)