]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/networkd-address.c
network: update address infomation even if link is in failed or linger state
[thirdparty/systemd.git] / 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);