diff options
| author | Roy Marples <roy@marples.name> | 2020-11-24 10:30:08 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-11-24 10:30:08 +0000 |
| commit | 3ca5bffd2de92ee21ea733cb0b2716a0a975942d (patch) | |
| tree | 0338f4bd537d03644e7df7bb82e2bb24784078f1 | |
| parent | 7c1f6fe6343e3d3be8eb29ce7400f81f4b15df38 (diff) | |
| download | dhcpcd-3ca5bffd2de92ee21ea733cb0b2716a0a975942d.tar.xz | |
DHCP: If error adding the address in oneshot, exit with failure
Otherwise we loop.
It's unlikely oneshot would be used with IPv6 due to addresses
having lifetimes.
| -rw-r--r-- | src/dhcp.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -2365,8 +2365,15 @@ dhcp_bind(struct interface *ifp) } /* Add the address */ - if (ipv4_applyaddr(ifp) == NULL) + if (ipv4_applyaddr(ifp) == NULL) { + /* There was an error adding the address. + * If we are in oneshot, exit with a failure. */ + if (ctx->options & DHCPCD_ONESHOT) { + loginfox("exiting due to oneshot"); + eloop_exit(ctx->eloop, EXIT_FAILURE); + } return; + } /* Close the BPF filter as we can now receive DHCP messages * on a UDP socket. */ |
