From: David Hankins Date: Sun, 9 Jul 2006 15:39:48 +0000 (+0000) Subject: - If the dhclient were to receive a DHCPNAK while it was in the RENEW X-Git-Tag: DHCPv6_parsing_base~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cbc66298bab6a4da91df8c0d3fbe16b649c6e69;p=thirdparty%2Fdhcp.git - 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] --- diff --git a/RELNOTES b/RELNOTES index 13d813c3a..a2e4d8e90 100644 --- a/RELNOTES +++ b/RELNOTES @@ -144,6 +144,13 @@ and for prodding me into improving it. configuration option - the default configuration and results should be more clear now. +- 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. + Changes since 3.0.4rc1 - The dhcp-options.5 manpage was updated to correct indentation errors diff --git a/client/dhclient.c b/client/dhclient.c index 094df7f1d..fff2f3e1a 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;