From: Yu Watanabe Date: Thu, 23 Jul 2020 22:18:39 +0000 (+0900) Subject: network: update address infomation even if link is in failed or linger state X-Git-Tag: v246~14^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea121d8f252010ee796a0d6b6bb383c893c4ce55;p=thirdparty%2Fsystemd.git network: update address infomation even if link is in failed or linger state As the link may be reconfigured later. If we do not update the address information, then its setup state or operstate may not be updated correctly. --- diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 747acfe6c5e..b09d75e6158 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -355,11 +355,8 @@ int address_update( int r; assert(address); + assert(address->link); assert(cinfo); - assert_return(address->link, 1); - - if (IN_SET(address->link->state, LINK_STATE_FAILED, LINK_STATE_LINGER)) - return 1; ready = address_is_ready(address); @@ -367,6 +364,9 @@ int address_update( address->scope = scope; address->cinfo = *cinfo; + if (IN_SET(address->link->state, LINK_STATE_FAILED, LINK_STATE_LINGER)) + return 0; + link_update_operstate(address->link, true); link_check_ready(address->link);