Avoid a null pointer dereference by not expiring our lease if we don't

have an active one.

Submitted by:	sam
Reported by:	James Snow <snow at teardrop dot org>
Approved by:	re (dhclient blanket)
This commit is contained in:
Brooks Davis 2005-06-13 23:43:08 +00:00
parent 30d0a60aed
commit 59eac186e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147351

View File

@ -257,12 +257,15 @@ routehandler(struct protocol *p)
* state and then wait for either a link down
* notification or an associate event.
*/
script_init("EXPIRE", NULL);
script_write_params("old_", ifi->client->active);
if (ifi->client->alias)
script_write_params("alias_",
ifi->client->alias);
script_go();
if (ifi->client->active != NULL) {
script_init("EXPIRE", NULL);
script_write_params("old_",
ifi->client->active);
if (ifi->client->alias)
script_write_params("alias_",
ifi->client->alias);
script_go();
}
ifi->client->state = S_INIT;
break;
}