summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2006-07-09 15:39:48 +0000
committerDavid Hankins <dhankins@isc.org>2006-07-09 15:39:48 +0000
commit6cbc66298bab6a4da91df8c0d3fbe16b649c6e69 (patch)
tree636033975bccbe74c62b72259e54ee185d79c280 /client
parente48891e8db56950b8d30fe8bf8110c5ff3dcaad8 (diff)
downloadisc-dhcp-6cbc66298bab6a4da91df8c0d3fbe16b649c6e69.tar.gz
- If the dhclient were to receive a DHCPNAK while it was in the RENEW
state (and consequently, had an active, 'bound' address and related configuration options), it would fail to 'tear down' this information before proceeding into INIT state. dhclient now iterates the dhclient- script with the 'EXPIRE' action to cause these teardowns prior to entering INIT state. [ISC-Bugs #16035]
Diffstat (limited to 'client')
-rw-r--r--client/dhclient.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/client/dhclient.c b/client/dhclient.c
index 094df7f1..fff2f3e1 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -32,7 +32,7 @@
#ifndef lint
static char ocopyright[] =
-"$Id: dhclient.c,v 1.140 2006/06/06 16:35:18 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.141 2006/07/09 15:39:48 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -1377,6 +1377,17 @@ void dhcpnak (packet)
return;
}
+ /* If we get a DHCPNAK, we use the EXPIRE dhclient-script state
+ * to indicate that we want all old bindings to be removed. (It
+ * is possible that we may get a NAK while in the RENEW state,
+ * so we might have bindings active at that time)
+ */
+ script_init(client, "EXPIRE", NULL);
+ script_write_params(client, "old_", client->active);
+ if (client->alias)
+ script_write_params(client, "alias_", client->alias);
+ script_go(client);
+
destroy_client_lease (client -> active);
client -> active = (struct client_lease *)0;