]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: Fix -b --background
authorRoy Marples <roy@marples.name>
Thu, 8 May 2025 15:49:44 +0000 (16:49 +0100)
committerRoy Marples <roy@marples.name>
Fri, 9 May 2025 08:09:57 +0000 (09:09 +0100)
It's been broken for a while... just the 11 years ago in 1d5d236
Initial fix for #423

src/dhcpcd.c
src/if-options.h

index 3e138cbc490b01c86d6e33dd2cb1b5e535d4a2ab..1f0fabb60ba35ad3932fba391b32ac12dbf6b560 100644 (file)
@@ -208,7 +208,8 @@ handle_exit_timeout(void *arg)
                eloop_exit(ctx->eloop, EXIT_FAILURE);
                return;
        }
-       ctx->options |= DHCPCD_NOWAITIP;
+
+       ctx->options |= DHCPCD_BACKGROUND;
        dhcpcd_daemonise(ctx);
 }
 
@@ -366,7 +367,7 @@ dhcpcd_daemonise(struct dhcpcd_ctx *ctx)
        int exit_code;
 
        if (ctx->options & DHCPCD_DAEMONISE &&
-           !(ctx->options & (DHCPCD_DAEMONISED | DHCPCD_NOWAITIP)))
+           !(ctx->options & (DHCPCD_DAEMONISED | DHCPCD_BACKGROUND)))
        {
                if (!dhcpcd_ipwaited(ctx))
                        return;
index dc79f639b52a86513642e957b735460513346573..a92697e12a4b1eb0c8668dbbf8e65fdb0a755b4f 100644 (file)
@@ -63,7 +63,7 @@
 #define DHCPCD_RTBUILD                 (1ULL << 2)
 #define DHCPCD_GATEWAY                 (1ULL << 3)
 #define DHCPCD_STATIC                  (1ULL << 4)
-//#define DHCPCD_DEBUG                 (1ULL << 5)
+// unused                              (1ULL << 5)
 #define DHCPCD_ARP_PERSISTDEFENCE      (1ULL << 6)
 #define DHCPCD_LASTLEASE               (1ULL << 7)
 #define DHCPCD_INFORM                  (1ULL << 8)
@@ -81,7 +81,7 @@
 #define DHCPCD_ANONYMOUS               (1ULL << 21)
 #define DHCPCD_BACKGROUND              (1ULL << 22)
 #define DHCPCD_VENDORRAW               (1ULL << 23)
-#define DHCPCD_NOWAITIP                        (1ULL << 24) /* To force daemonise */
+// unused                              (1ULL << 24)
 #define DHCPCD_WAITIP                  (1ULL << 25)
 #define DHCPCD_SLAACPRIVATE            (1ULL << 26)
 #define DHCPCD_CSR_WARNED              (1ULL << 27)