Mercurial > hg > dhcpcd
comparison src/dhcp.c @ 5549:6d72dc67a984 draft
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.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Tue, 24 Nov 2020 10:30:08 +0000 |
| parents | bcca2ff28a64 |
| children | 5bf8e1fc0634 |
comparison
equal
deleted
inserted
replaced
| 5548:bcca2ff28a64 | 5549:6d72dc67a984 |
|---|---|
| 2363 } | 2363 } |
| 2364 return; | 2364 return; |
| 2365 } | 2365 } |
| 2366 | 2366 |
| 2367 /* Add the address */ | 2367 /* Add the address */ |
| 2368 if (ipv4_applyaddr(ifp) == NULL) | 2368 if (ipv4_applyaddr(ifp) == NULL) { |
| 2369 return; | 2369 /* There was an error adding the address. |
| 2370 * If we are in oneshot, exit with a failure. */ | |
| 2371 if (ctx->options & DHCPCD_ONESHOT) { | |
| 2372 loginfox("exiting due to oneshot"); | |
| 2373 eloop_exit(ctx->eloop, EXIT_FAILURE); | |
| 2374 } | |
| 2375 return; | |
| 2376 } | |
| 2370 | 2377 |
| 2371 /* Close the BPF filter as we can now receive DHCP messages | 2378 /* Close the BPF filter as we can now receive DHCP messages |
| 2372 * on a UDP socket. */ | 2379 * on a UDP socket. */ |
| 2373 dhcp_closebpf(ifp); | 2380 dhcp_closebpf(ifp); |
| 2374 | 2381 |
