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: 3a23834d6b
This commit is contained in:
parent
a2be8be2cf
commit
8bc63a0b13
|
@ -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,
|
* 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. */
|
* 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) {
|
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) {
|
static int cmp_uint8(const uint8_t *a, const uint8_t *b) {
|
||||||
|
|
Loading…
Reference in New Issue