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.
This commit is contained in:
Yu Watanabe 2020-07-24 07:18:39 +09:00
parent e55265184b
commit ea121d8f25
1 changed files with 4 additions and 4 deletions

View File

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