# HG changeset patch # User Roy Marples # Date 1606213808 0 # Node ID 6d72dc67a984a0092cbe967db28994a770fe76d1 # Parent bcca2ff28a6448bd6311589ac008439258f804d0 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. diff -r bcca2ff28a64 -r 6d72dc67a984 src/dhcp.c --- a/src/dhcp.c Mon Nov 23 13:22:20 2020 +0000 +++ b/src/dhcp.c Tue Nov 24 10:30:08 2020 +0000 @@ -2365,8 +2365,15 @@ } /* 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. */