When dhcpleasectl asks to send a new request on an interface we are
authorflorian <florian@openbsd.org>
Fri, 23 Jul 2021 11:56:01 +0000 (11:56 +0000)
committerflorian <florian@openbsd.org>
Fri, 23 Jul 2021 11:56:01 +0000 (11:56 +0000)
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.

sbin/dhcpleased/engine.c

index 0903c17..20ed7c4 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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;
                                }
                        }