From: Ted Lemon Date: Wed, 22 Sep 1999 17:30:33 +0000 (+0000) Subject: Get rid of any 'on' statements on a lease before running the in-scope statements. X-Git-Tag: V3-BETA-1-PATCH-2~5^2~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed2529e5bfdfa7483d957a2c2af3b31ac0e534d0;p=thirdparty%2Fdhcp.git Get rid of any 'on' statements on a lease before running the in-scope statements. --- diff --git a/server/dhcp.c b/server/dhcp.c index 856140def..664750e3a 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.106 1999/08/19 18:59:13 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.107 1999/09/22 17:30:33 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -871,6 +871,19 @@ void ack_lease (packet, lease, offer, when, msg) (struct agent_options *)0; } + /* Get rid of any old expiry or release statements - by executing + the statements below, we will be inserting new ones if there are + any to insert. */ + if (lease -> on_expiry) + executable_statement_dereference (&lease -> on_expiry, + "ack_lease"); + if (lease -> on_commit) + executable_statement_dereference (&lease -> on_commit, + "ack_lease"); + if (lease -> on_release) + executable_statement_dereference (&lease -> on_release, + "ack_lease"); + /* Execute statements in scope starting with the subnet scope. */ execute_statements_in_scope (packet, lease, packet -> options,