From d877ffb047b709512a84ee01551a463c565ed1b4 Mon Sep 17 00:00:00 2001 From: mbr Date: Mon, 16 Aug 2004 16:09:50 +0000 Subject: 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 --- contrib/isc-dhcp/client/dhclient.c | 15 +++++++++++++-- 1 file 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); -- cgit v1.1