diff options
author | Dan Streetman <ddstreet@canonical.com> | 2020-12-15 23:59:12 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-12-16 11:49:31 +0100 |
commit | 8bc63a0b1355a8362e50b449b2ae9979122a2521 (patch) | |
tree | 50df62940b2a4b767663f1aa2c6fae866fb9dbbf /src/libsystemd-network | |
parent | coredumpctl: Add --debugger-args= option (diff) | |
download | systemd-8bc63a0b1355a8362e50b449b2ae9979122a2521.tar.xz systemd-8bc63a0b1355a8362e50b449b2ae9979122a2521.zip |
sd-dhcp-client: fix renew/rebind timeout calculation to avoid infinite loop
unfortunately I missed adding the timeout to 'now' which results in
an endless loop of renewal timeouts.
Fixes: 3a23834d6b0da391c1ba9cb79a7d7deea7125f4b
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 0c2eb91ae3..939dbac5bb 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -759,7 +759,7 @@ static usec_t client_compute_request_timeout(usec_t now, uint64_t attempt) { * Note that while the default T1/T2 initial times do have random 'fuzz' applied, * the RFC sec 4.4.5 does not mention adding any fuzz to retries. */ static usec_t client_compute_reacquisition_timeout(usec_t now, usec_t expire) { - return MAX(usec_sub_unsigned(expire, now) / 2, 60 * USEC_PER_SEC); + return now + MAX(usec_sub_unsigned(expire, now) / 2, 60 * USEC_PER_SEC); } static int cmp_uint8(const uint8_t *a, const uint8_t *b) { |