diff options
author | Martin Blapp <mbr@FreeBSD.org> | 2004-08-16 16:09:50 +0000 |
---|---|---|
committer | Martin Blapp <mbr@FreeBSD.org> | 2004-08-16 16:09:50 +0000 |
commit | 222bb5ab84fbcdff3f3f34aa22c99dae827feb9e (patch) | |
tree | 7a39d960cc67d0cc0370e55da1556a6b2ad396b1 /contrib | |
parent | c3c04b646f260664dba5447d6270c3a334cab180 (diff) | |
download | src-222bb5ab84fbcdff3f3f34aa22c99dae827feb9e.tar.gz src-222bb5ab84fbcdff3f3f34aa22c99dae827feb9e.zip |
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>
Notes
Notes:
svn path=/head/; revision=133867
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 8354fe6ba997..a942051a1168 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); |