]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp6-lease: fix calculation of t2
authorBeniamino Galvani <b.galvani@gmail.com>
Mon, 21 Jul 2025 12:24:27 +0000 (14:24 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 21 Jul 2025 17:15:43 +0000 (02:15 +0900)
sd_dhcp6_lease_get_t2() was returning t1, and so the client was going directly
to the rebind state skipping the lease renewal.

Reported-by: Jaime Caamano <jcaamano@redhat.com>
Fixes: 394fac52d0e7 ("sd-dhcp6-client: introduce sd_dhcp6_lease_get_t1() and friends")
src/libsystemd-network/sd-dhcp6-lease.c

index 4d8df252c87d6d315a2f6859f7c08b61c2b8d089..80ae1b775f44bfb7394559ab3036a51e4c3c6abe 100644 (file)
@@ -115,7 +115,7 @@ static void dhcp6_lease_set_lifetime(sd_dhcp6_lease *lease) {
         }
 
 DEFINE_GET_TIME_FUNCTIONS(t1, lifetime_t1);
-DEFINE_GET_TIME_FUNCTIONS(t2, lifetime_t1);
+DEFINE_GET_TIME_FUNCTIONS(t2, lifetime_t2);
 DEFINE_GET_TIME_FUNCTIONS(valid_lifetime, lifetime_valid);
 
 static void dhcp6_lease_set_server_address(sd_dhcp6_lease *lease, const struct in6_addr *server_address) {