]> 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)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 4 Aug 2025 14:43:56 +0000 (15:43 +0100)
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")
(cherry picked from commit 8f5eaeb143dd9e58503980ae5f63dd78c463180e)

src/libsystemd-network/sd-dhcp6-lease.c

index 2ff1e87a2e461ca2b3dfdeb671c3b60df8a255d4..3f2b220967e8835dfc3a3e08ab947e9afd8c334b 100644 (file)
@@ -112,7 +112,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) {