From c6b4c3c36a60ef8424043638990745a0f7667ce0 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 4 Aug 2021 05:56:58 +0000 Subject: [PATCH] Do not enter a tight INIT -> REQUESTING -> INIT loop when the dhcp server responds to our DHCPDISCOVER but is then slow to respond to our DHCPREQUEST. MAX_EXP_BACKOFF_FAST was introduced to get us quickly out of the REBOOTING state when we switch networks and no dhcp server would NAK our old lease but just ignore us. This is not the issue here, there is a dhcp server willing to talk to us, it's just slow. Problem reported, tested & OK jca --- sbin/dhcpleased/engine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/dhcpleased/engine.c b/sbin/dhcpleased/engine.c index 79ea38c8d22..076a57e9ba6 100644 --- a/sbin/dhcpleased/engine.c +++ b/sbin/dhcpleased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.23 2021/08/01 09:07:03 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.24 2021/08/04 05:56:58 florian Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -1389,7 +1389,7 @@ iface_timeout(int fd, short events, void *arg) state_transition(iface, IF_REBOOTING); break; case IF_REQUESTING: - if (iface->timo.tv_sec >= MAX_EXP_BACKOFF_FAST) + if (iface->timo.tv_sec >= MAX_EXP_BACKOFF_SLOW) state_transition(iface, IF_INIT); else state_transition(iface, IF_REQUESTING); -- 2.20.1