Merge pull request #29718 from yuwata/networkd-update-state-file-after-dhcp6-information-request

network: update state file when DHCPv6 reply for INFORMATION-REQUEST is received
This commit is contained in:
Frantisek Sumsal
2023-10-26 08:16:57 +00:00
committed by GitHub
2 changed files with 5 additions and 2 deletions
+5 -1
View 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) {
@@ -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)