diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-01-30 12:18:35 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-01-31 06:44:32 +0100 |
commit | 9de8a4259eaebf4635142474e016b90ce5be5181 (patch) | |
tree | b0bf4e6e3743e5bee5cf422f5c35f967f915171f /src/libsystemd-network/sd-dhcp6-client.c | |
parent | po: update Polish translation (diff) | |
download | systemd-9de8a4259eaebf4635142474e016b90ce5be5181.tar.xz systemd-9de8a4259eaebf4635142474e016b90ce5be5181.zip |
dhcp6: do not use T1 and T2 longer than one provided by the lease
Fixes #12623.
Diffstat (limited to '')
-rw-r--r-- | src/libsystemd-network/sd-dhcp6-client.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 5417ba8c5f..9c4ce247d5 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) { |