]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: update state file when DHCPv6 reply for INFORMATION-REQUEST is received
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 26 Oct 2023 03:19:40 +0000 (12:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 26 Oct 2023 03:23:42 +0000 (12:23 +0900)
Otherwise, received information, e.g. DNS servers, may not be saved in
the state file, and will not be propagated to clients like resolved.

Fixes the first issue of #29678.

src/network/networkd-dhcp6.c

index 6044411a75f6f7ee9290efeb633302b90c6fc8f6..0aa56bffbc7c6726ab6b8a9baaa1ace3db3fba93 100644 (file)
@@ -16,6 +16,7 @@
 #include "networkd-manager.h"
 #include "networkd-queue.h"
 #include "networkd-route.h"
+#include "networkd-state-file.h"
 #include "string-table.h"
 #include "string-util.h"
 
@@ -351,7 +352,10 @@ static int dhcp6_lease_information_acquired(sd_dhcp6_client *client, Link *link)
         if (r < 0)
                 return log_link_error_errno(link, r, "Failed to get DHCPv6 lease: %m");
 
-        return unref_and_replace_full(link->dhcp6_lease, lease, sd_dhcp6_lease_ref, sd_dhcp6_lease_unref);
+        unref_and_replace_full(link->dhcp6_lease, lease, sd_dhcp6_lease_ref, sd_dhcp6_lease_unref);
+
+        link_dirty(link);
+        return 0;
 }
 
 static int dhcp6_lease_lost(Link *link) {