diff options
author | mbr <mbr@FreeBSD.org> | 2004-08-16 16:09:50 +0000 |
---|---|---|
committer | mbr <mbr@FreeBSD.org> | 2004-08-16 16:09:50 +0000 |
commit | d877ffb047b709512a84ee01551a463c565ed1b4 (patch) | |
tree | 7a39d960cc67d0cc0370e55da1556a6b2ad396b1 /contrib | |
parent | 3a70dff6bb4fe5e169cb596a57f322db03ff7592 (diff) | |
download | FreeBSD-src-d877ffb047b709512a84ee01551a463c565ed1b4.zip FreeBSD-src-d877ffb047b709512a84ee01551a463c565ed1b4.tar.gz |
It could happen that the renew/rebind times in the leasefile were
expired but the expire time itself was still valid and in the future.
If this happened we ended up using the state S_RENEW with an
INADDR_BROADCAST address set in the request and dhclient never got
any answer back. The only workaround was to delete the lease file.
Fix this case with a check for the S_RENEW and a fallback to the
S_INIT state.
PR: bin/69361
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/isc-dhcp/client/dhclient.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/contrib/isc-dhcp/client/dhclient.c b/contrib/isc-dhcp/client/dhclient.c index 8354fe6..a942051 100644 --- a/contrib/isc-dhcp/client/dhclient.c +++ b/contrib/isc-dhcp/client/dhclient.c @@ -1735,9 +1735,20 @@ void send_request (cpp) broadcast the DHCPREQUEST rather than unicasting. */ if (client -> state == S_REQUESTING || client -> state == S_REBOOTING || - cur_time > client -> active -> rebind) + cur_time > client -> active -> rebind) { +#ifdef ENABLE_POLLING_MODE + /* + * If our state is S_RENEWING we definitly + * have to go through S_INIT first. This can + * happen only if ENABLE_POLLING_MODE is defined. + */ + if (client -> state == S_RENEWING) { + state_init (client); + return; + } +#endif destination.sin_addr = sockaddr_broadcast.sin_addr; - else + } else memcpy (&destination.sin_addr.s_addr, client -> destination.iabuf, sizeof destination.sin_addr.s_addr); |