From ef0a234a75c41ffd19e062fffe28fa181996ca45 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 26 Oct 2023 12:19:40 +0900 Subject: [PATCH 1/2] 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 6044411a75..0aa56bffbc 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) { From dd59a609bec5bf2250b1bb2519f61e96dadeb103 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 26 Oct 2023 12:26:15 +0900 Subject: [PATCH 2/2] test-network: suppress too much outputs of state file Follow-up for 0f9efffaeb84964a3ab0f32271fba38f3bee2394. --- test/test-network/systemd-networkd-tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 58c289748d..f4c8a62768 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -5126,7 +5126,6 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): # Let's wait for the expected DNS server being listed in the state file. for _ in range(100): output = read_link_state_file('veth99') - print(output) if 'DNS=2600::ee' in output: break time.sleep(.2)