]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/dhcp6: keep lease when running in information request mode
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 8 Oct 2023 07:20:15 +0000 (16:20 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 8 Oct 2023 07:22:29 +0000 (16:22 +0900)
Fixes #28566.

src/network/networkd-dhcp6.c

index 5fb1b6bdad778251dcd4b79af186451a86429ed0..6044411a75f6f7ee9290efeb633302b90c6fc8f6 100644 (file)
@@ -341,7 +341,17 @@ static int dhcp6_lease_ip_acquired(sd_dhcp6_client *client, Link *link) {
 }
 
 static int dhcp6_lease_information_acquired(sd_dhcp6_client *client, Link *link) {
-        return 0;
+        sd_dhcp6_lease *lease;
+        int r;
+
+        assert(client);
+        assert(link);
+
+        r = sd_dhcp6_client_get_lease(client, &lease);
+        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);
 }
 
 static int dhcp6_lease_lost(Link *link) {