Skip to content

Commit ea121d8

Browse files
committed
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.
1 parent e552651 commit ea121d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/network/networkd-address.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,18 +355,18 @@ int address_update(
355355
int r;
356356

357357
assert(address);
358+
assert(address->link);
358359
assert(cinfo);
359-
assert_return(address->link, 1);
360-
361-
if (IN_SET(address->link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
362-
return 1;
363360

364361
ready = address_is_ready(address);
365362

366363
address->flags = flags;
367364
address->scope = scope;
368365
address->cinfo = *cinfo;
369366

367+
if (IN_SET(address->link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
368+
return 0;
369+
370370
link_update_operstate(address->link, true);
371371
link_check_ready(address->link);
372372

0 commit comments

Comments
 (0)