]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP: Don't really expire the lease when testing
authorRoy Marples <roy@marples.name>
Mon, 8 Jun 2026 14:24:31 +0000 (15:24 +0100)
committerRoy Marples <roy@marples.name>
Mon, 8 Jun 2026 14:47:59 +0000 (15:47 +0100)
src/dhcp.c

index b9419ad84d96a0663df0907e23970c532f2d7b7e..d22a99b1ddb0a48865496c9147b301f4b7a5ac33 100644 (file)
@@ -2024,8 +2024,10 @@ dhcp_expire(void *arg)
                state->added |= STATE_EXPIRED;
        } else {
                logerrx("%s: DHCP lease expired", ifp->name);
-               dhcp_drop(ifp, "EXPIRE");
-               dhcp_unlink(ifp->ctx, state->leasefile);
+               if (!(ifp->ctx->options & DHCPCD_TEST)) {
+                       dhcp_drop(ifp, "EXPIRE");
+                       dhcp_unlink(ifp->ctx, state->leasefile);
+               }
        }
        state->interval = 0;
        dhcp_discover(ifp);