diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-10-08 09:20:15 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-10-08 09:22:29 +0200 |
commit | 9709f9edc58ac9f977e4bbef8b5595cee928bc9f (patch) | |
tree | 983e7503dfc409785b500ef1c28513ce2c1ae48a /src/network/networkd-dhcp6.c | |
parent | network/dhcp6: shorten dhcp6_handler() (diff) | |
download | systemd-9709f9edc58ac9f977e4bbef8b5595cee928bc9f.tar.xz systemd-9709f9edc58ac9f977e4bbef8b5595cee928bc9f.zip |
network/dhcp6: keep lease when running in information request mode
Fixes #28566.
Diffstat (limited to 'src/network/networkd-dhcp6.c')
-rw-r--r-- | src/network/networkd-dhcp6.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index 5fb1b6bdad..6044411a75 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -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) { |