Skip to content

Commit 9e4a4f3

Browse files
committed
dhcpcd: fork to background on initial timeout
Unless the -1, --oneshot option is given. dhcpcd should keep on trying to configure the interface. Fixes #423
1 parent 109861c commit 9e4a4f3

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/dhcpcd.8.in

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -522,18 +522,19 @@ option instead.
522522
Timeout after
523523
.Ar seconds ,
524524
instead of the default 30.
525+
On timeout,
526+
.Nm
527+
will exit if the
528+
.Fl 1 ,
529+
.Fl Fl oneshot
530+
option has been given,
531+
otherwise it will fork into the background and keep on
532+
trying.
525533
A setting of 0
526534
.Ar seconds
527535
causes
528536
.Nm
529537
to wait forever to get a lease.
530-
If
531-
.Nm
532-
is working on a single interface then
533-
.Nm
534-
will exit when a timeout occurs, otherwise
535-
.Nm
536-
will fork into the background.
537538
.It Fl u , Fl Fl userclass Ar class
538539
Tags the DHCPv4 message with the userclass
539540
.Ar class .

src/dhcpcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ handle_exit_timeout(void *arg)
198198

199199
ctx = arg;
200200
logerrx("timed out");
201-
if (!(ctx->options & DHCPCD_MANAGER)) {
201+
if (ctx->options & DHCPCD_ONESHOT) {
202202
struct interface *ifp;
203203

204204
TAILQ_FOREACH(ifp, ctx->ifaces, next) {

0 commit comments

Comments
 (0)