From: florian Date: Sun, 14 Nov 2021 18:13:19 +0000 (+0000) Subject: When we transition from RENEWING to REBINDING state we have to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=aefb9fc245b83655f90303a127c60e6eaac6cf07;p=openbsd When we transition from RENEWING to REBINDING state we have to calculate the next timeout based on the rebinding time (T2), not renewal time (T1). At this point T1 already expired and we would wait way too long, past the lease lifetime. Spotted while investigating a problem reported by Zack Newman on misc@ --- diff --git a/sbin/dhcpleased/engine.c b/sbin/dhcpleased/engine.c index 2033ea6ac76..17e65fbe789 100644 --- a/sbin/dhcpleased/engine.c +++ b/sbin/dhcpleased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.28 2021/10/28 09:44:49 kn Exp $ */ +/* $OpenBSD: engine.c,v 1.29 2021/11/14 18:13:19 florian Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -1394,7 +1394,7 @@ state_transition(struct dhcpleased_iface *iface, enum if_state new_state) if (old_state == IF_RENEWING) { iface->dhcp_server.s_addr = INADDR_ANY; iface->timo.tv_sec = (iface->lease_time - - iface->renewal_time) / 2; /* RFC 2131 4.4.5 */ + iface->rebinding_time) / 2; /* RFC 2131 4.4.5 */ } else iface->timo.tv_sec /= 2; request_dhcp_request(iface);