]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: fork to background on initial timeout
authorRoy Marples <roy@marples.name>
Thu, 8 May 2025 16:26:52 +0000 (17:26 +0100)
committerRoy Marples <roy@marples.name>
Fri, 9 May 2025 08:09:57 +0000 (09:09 +0100)
Unless the -1, --oneshot option is given.
dhcpcd should keep on trying to configure the interface.
Fixes #423

src/dhcpcd.8.in
src/dhcpcd.c

index 83f6399dcb2079f4273739a070f818b68e350d1d..66818b3a84c4a3dfe439c9a7a6f6dec8dbd5ec2a 100644 (file)
@@ -522,18 +522,19 @@ option instead.
 Timeout after
 .Ar seconds ,
 instead of the default 30.
+On timeout,
+.Nm
+will exit if the
+.Fl 1 ,
+.Fl Fl oneshot
+option has been given,
+otherwise it will fork into the background and keep on
+trying.
 A setting of 0
 .Ar seconds
 causes
 .Nm
 to wait forever to get a lease.
-If
-.Nm
-is working on a single interface then
-.Nm
-will exit when a timeout occurs, otherwise
-.Nm
-will fork into the background.
 .It Fl u , Fl Fl userclass Ar class
 Tags the DHCPv4 message with the userclass
 .Ar class .
index 1f0fabb60ba35ad3932fba391b32ac12dbf6b560..3e65141e164224dcc1076ad28bfb1844541d6b68 100644 (file)
@@ -198,7 +198,7 @@ handle_exit_timeout(void *arg)
 
        ctx = arg;
        logerrx("timed out");
-       if (!(ctx->options & DHCPCD_MANAGER)) {
+       if (ctx->options & DHCPCD_ONESHOT) {
                struct interface *ifp;
 
                TAILQ_FOREACH(ifp, ctx->ifaces, next) {