From ef0a234a75c41ffd19e062fffe28fa181996ca45 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 26 Oct 2023 12:19:40 +0900 Subject: [PATCH] network: update state file when DHCPv6 reply for INFORMATION-REQUEST is received 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index 6044411a75f..0aa56bffbc7 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -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) { -- 2.47.3