From: Yu Watanabe Date: Thu, 30 Jan 2020 11:18:35 +0000 (+0900) Subject: dhcp6: do not use T1 and T2 longer than one provided by the lease X-Git-Tag: v245-rc1~33^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9de8a4259eaebf4635142474e016b90ce5be5181;p=thirdparty%2Fsystemd.git dhcp6: do not use T1 and T2 longer than one provided by the lease Fixes #12623. --- diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 5417ba8c5fe..9c4ce247d5d 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -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) {