From 238c75989980bccc857a3f7a74e3451f36d212e5 Mon Sep 17 00:00:00 2001 From: Karl Fessel Date: Fri, 23 Jul 2021 17:46:14 +0200 Subject: [PATCH] dhcpv6_client: mrd calculation fixed for renew and rebind mrd calculation for dhcp-renew was wrong this fixes it and the logic for dhcp rebind mrd handling (try rebind if ther is mrd) see issue #16677 --- sys/net/application_layer/dhcpv6/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/application_layer/dhcpv6/client.c b/sys/net/application_layer/dhcpv6/client.c index 0e92501e36..319e843e7e 100644 --- a/sys/net/application_layer/dhcpv6/client.c +++ b/sys/net/application_layer/dhcpv6/client.c @@ -839,7 +839,7 @@ static void _request_renew_rebind(uint8_t type) case DHCPV6_RENEW: irt = DHCPV6_REN_TIMEOUT; mrt = DHCPV6_REN_MAX_RT; - mrd = rebind_time - t2; + mrd = rebind_time - _now_sec(); break; case DHCPV6_REBIND: { irt = DHCPV6_REB_TIMEOUT; @@ -858,7 +858,7 @@ static void _request_renew_rebind(uint8_t type) mrd = valid_until; } } - if (mrd > 0) { + if (mrd == 0) { /* all leases already expired, don't try to rebind and * solicit immediately */ _post_solicit_servers();