From: Roy Marples Date: Thu, 8 May 2025 15:49:44 +0000 (+0100) Subject: dhcpcd: Fix -b --background X-Git-Tag: v10.2.3~6 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=109861c52f26391ac9012df6d812eff3a91e09fa;p=thirdparty%2Fdhcpcd.git dhcpcd: Fix -b --background It's been broken for a while... just the 11 years ago in 1d5d236 Initial fix for #423 --- diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 3e138cbc..1f0fabb6 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -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; diff --git a/src/if-options.h b/src/if-options.h index dc79f639..a92697e1 100644 --- a/src/if-options.h +++ b/src/if-options.h @@ -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)