]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: preserve the STARTED option when reloading options
authorRoy Marples <roy@marples.name>
Wed, 17 Jun 2020 10:25:58 +0000 (11:25 +0100)
committerRoy Marples <roy@marples.name>
Wed, 17 Jun 2020 10:25:58 +0000 (11:25 +0100)
This avoids the truncated read when the launcher process exists
after the main process handles SIGHUP.

src/dhcpcd.c

index 18e373c9256e007cb66cc9f5c4f8ae80e0848c0c..281ab5e432a679f5296dafe9c7e2288a78a47cb9 100644 (file)
@@ -1299,7 +1299,9 @@ reload_config(struct dhcpcd_ctx *ctx)
        if ((ifo = read_config(ctx, NULL, NULL, NULL)) == NULL)
                return;
        add_options(ctx, NULL, ifo, ctx->argc, ctx->argv);
-       /* We need to preserve these two options. */
+       /* We need to preserve these options. */
+       if (ctx->options & DHCPCD_STARTED)
+               ifo->options |= DHCPCD_STARTED;
        if (ctx->options & DHCPCD_MASTER)
                ifo->options |= DHCPCD_MASTER;
        if (ctx->options & DHCPCD_DAEMONISED)