]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Get rid of any 'on' statements on a lease before running the in-scope statements.
authorTed Lemon <source@isc.org>
Wed, 22 Sep 1999 17:30:33 +0000 (17:30 +0000)
committerTed Lemon <source@isc.org>
Wed, 22 Sep 1999 17:30:33 +0000 (17:30 +0000)
server/dhcp.c

index 856140def11c81946199b879e98d6a7cf67923c4..664750e3aa2e806f5c730cb95f54d4c0efd66e17 100644 (file)
@@ -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,