Otherwise we loop.
It's unlikely oneshot would be used with IPv6 due to addresses
having lifetimes.
}
/* 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. */