]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dhcp6: do not use T1 and T2 longer than one provided by the lease
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 30 Jan 2020 11:18:35 +0000 (20:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 31 Jan 2020 05:44:32 +0000 (14:44 +0900)
Fixes #12623.

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

index 5417ba8c5febc40265c24a97f4347026f1899dcb..9c4ce247d5dc45c85daa182dfe6c21d965850f50 100644 (file)
@@ -675,8 +675,7 @@ static int client_timeout_resend_expire(sd_event_source *s, uint64_t usec, void
 }
 
 static usec_t client_timeout_compute_random(usec_t val) {
-        return val - val / 10 +
-                (random_u32() % (2 * USEC_PER_SEC)) * val / 10 / USEC_PER_SEC;
+        return val - (random_u32() % USEC_PER_SEC) * val / 10 / USEC_PER_SEC;
 }
 
 static int client_timeout_resend(sd_event_source *s, uint64_t usec, void *userdata) {