diff options
author | mbr <mbr@FreeBSD.org> | 2004-01-25 11:30:50 +0000 |
---|---|---|
committer | mbr <mbr@FreeBSD.org> | 2004-01-25 11:30:50 +0000 |
commit | 67b460e51746e303b944749a75f726464c98ab71 (patch) | |
tree | dffe241f74d640d75f8f1697ae5ebdb841c4ff6e /contrib/isc-dhcp | |
parent | 602ddad2956ca69294a132f44d58b92ef4544154 (diff) | |
download | FreeBSD-src-67b460e51746e303b944749a75f726464c98ab71.zip FreeBSD-src-67b460e51746e303b944749a75f726464c98ab71.tar.gz |
Dhclient dumps core on suspend/resume cycles. If the client isn't active
then we need to go to the reboot state or in state_bound it will core on
the de-reference of client -> active -> options since client -> active = NULL.
While we are here, fix the indentation.
Submitted by: Doug Ambrisko <ambrisko@ambrisko.com>
Diffstat (limited to 'contrib/isc-dhcp')
-rw-r--r-- | contrib/isc-dhcp/client/dhclient.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/isc-dhcp/client/dhclient.c b/contrib/isc-dhcp/client/dhclient.c index 15da9c9..da64326 100644 --- a/contrib/isc-dhcp/client/dhclient.c +++ b/contrib/isc-dhcp/client/dhclient.c @@ -3442,11 +3442,16 @@ void state_polling (cpp) */ for (client = ip -> client; client; client = client -> next) { - cancel_timeout (state_init, client); - cancel_timeout (state_reboot, client); - cancel_timeout (state_selecting, client); + cancel_timeout (state_init, client); + cancel_timeout (state_reboot, client); + cancel_timeout (state_selecting, client); + if (client -> active) { add_timeout (cur_time + random () % 5, - state_bound, client, 0, 0); + state_bound, client, 0, 0); + } else { + add_timeout (cur_time + random () % 5, + state_reboot, client, 0, 0); + } } ip -> linkstate = HAVELINK; } else { |