From: florian Date: Fri, 23 Jul 2021 11:56:01 +0000 (+0000) Subject: When dhcpleasectl asks to send a new request on an interface we are X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1c0be873779bc8c8cb4920ab60d3ee7fbdd49626;p=openbsd When dhcpleasectl asks to send a new request on an interface we are probably stuck in some way and the user wants a mostly clean slate. If we already have an IP address transition to state REBOOTING so that we no longer unicast dhcp requests. We will then try to reacquire our lease twice before giving up and transition to INIT and send dhcp discover messages accepting any IP address. --- diff --git a/sbin/dhcpleased/engine.c b/sbin/dhcpleased/engine.c index 0903c1792d1..20ed7c45da1 100644 --- a/sbin/dhcpleased/engine.c +++ b/sbin/dhcpleased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.19 2021/07/18 12:33:41 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.20 2021/07/23 11:56:01 florian Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -322,13 +322,13 @@ engine_dispatch_frontend(int fd, short event, void *bula) break; case IF_INIT: case IF_REQUESTING: + state_transition(iface, iface->state); + break; case IF_RENEWING: case IF_REBINDING: case IF_REBOOTING: - state_transition(iface, iface->state); - break; case IF_BOUND: - state_transition(iface, IF_RENEWING); + state_transition(iface, IF_REBOOTING); break; } }