diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2013-02-24 01:10:29 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2013-02-24 01:10:29 +0000 |
commit | 378f2d0ed3ec525bffcb248f271a228ed3d42539 (patch) | |
tree | 550cf142f1fd8f8c3895de2f70a1b7501d45097c /sbin | |
parent | 91949940374139351bc835e604b5efa19bf6d024 (diff) |
When no acceptable offers are received within the allowed timeframe call
state_panic() instead of state_init().
state_init() immediately issues a new DISCOVER message and neither
checks dhclient.leases.IF nor daemonizes.
state_panic() looks for a lease in dhclient.leases.IF, and if none
are available, waits for 'retry' seconds before retarting the
DISCOVER process. Most importantly it calls go_daemon() to take the
process into the background, giving back the command prompt.
Reported by otto@ and deraadt@. ok deraadt@.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhclient.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index d6f0835cc11..591636e8bf8 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.238 2013/02/19 23:40:25 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.239 2013/02/24 01:10:28 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -663,11 +663,12 @@ state_selecting(void) } client->offered_leases = NULL; - /* If we just tossed all the leases we were offered, go back - to square one. */ + /* + * If we just tossed all the leases we were offered, go back + * to square one. + */ if (!picked) { - client->state = S_INIT; - state_init(); + state_panic(); return; } @@ -1148,7 +1149,7 @@ state_panic(void) time_t cur_time; time(&cur_time); - note("No DHCPOFFERS received."); + note("No acceptable DHCPOFFERS received."); /* We may not have an active lease, but we may have some predefined leases that we can try. */ |