]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: update address infomation even if link is in failed or linger state
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 23 Jul 2020 22:18:39 +0000 (07:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Jul 2020 17:05:05 +0000 (02:05 +0900)
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.

src/network/networkd-address.c

index 747acfe6c5e564db81e45a9547a7c2ca4c31ea19..b09d75e6158e7e6e39ba0ce891eaad5aa93ee1ad 100644 (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);