From: florian Date: Sun, 2 Jun 2024 12:39:26 +0000 (+0000) Subject: Switch to rebinding at the rebinding time not when one timeout past. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c5d4eb4e330674d20e667c63e1217f69b6a4276f;p=openbsd Switch to rebinding at the rebinding time not when one timeout past. Spotted while hacking on dhcp6leased(8) --- diff --git a/sbin/dhcpleased/engine.c b/sbin/dhcpleased/engine.c index 84d02cc12ee..99433ed0500 100644 --- a/sbin/dhcpleased/engine.c +++ b/sbin/dhcpleased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.43 2024/02/13 12:53:05 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.44 2024/06/02 12:39:26 florian Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -1544,7 +1544,7 @@ iface_timeout(int fd, short events, void *arg) timespecsub(&now, &iface->request_time, &res); log_debug("%s: res.tv_sec: %lld, rebinding_time: %u", __func__, res.tv_sec, iface->rebinding_time); - if (res.tv_sec > iface->rebinding_time) + if (res.tv_sec >= iface->rebinding_time) state_transition(iface, IF_REBINDING); else state_transition(iface, IF_RENEWING);