summaryrefslogtreecommitdiff
path: root/common/memory.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>1999-09-22 17:24:11 +0000
committerTed Lemon <source@isc.org>1999-09-22 17:24:11 +0000
commita2e08b0a78c98a3b9d35449a503736bbb5f461df (patch)
tree7c681c546d4da6add63b24d73fc3e038c6b7405f /common/memory.c
parentfa098be8f9b723c78a0cb4479b8d297dbece3c9e (diff)
downloadisc-dhcp-a2e08b0a78c98a3b9d35449a503736bbb5f461df.tar.gz
In supersede_lease, replace 'on' statements if new values are provided.
Diffstat (limited to 'common/memory.c')
-rw-r--r--common/memory.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/common/memory.c b/common/memory.c
index 08fa799b..b31ea545 100644
--- a/common/memory.c
+++ b/common/memory.c
@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
-"$Id: memory.c,v 1.59 1999/09/16 05:12:33 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: memory.c,v 1.60 1999/09/22 17:24:11 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -756,6 +756,31 @@ int supersede_lease (comp, lease, commit)
comp -> hardware_addr = lease -> hardware_addr;
comp -> flags = ((lease -> flags & ~PERSISTENT_FLAGS) |
(comp -> flags & ~EPHEMERAL_FLAGS));
+
+ if (lease -> on_expiry) {
+ if (comp -> on_expiry)
+ executable_statement_dereference (&comp -> on_expiry,
+ "supersede_lease");
+ executable_statement_reference (&comp -> on_expiry,
+ lease -> on_expiry,
+ "supersede_lease");
+ }
+ if (lease -> on_commit) {
+ if (comp -> on_commit)
+ executable_statement_dereference (&comp -> on_commit,
+ "supersede_lease");
+ executable_statement_reference (&comp -> on_commit,
+ lease -> on_commit,
+ "supersede_lease");
+ }
+ if (lease -> on_release) {
+ if (comp -> on_release)
+ executable_statement_dereference (&comp -> on_release,
+ "supersede_lease");
+ executable_statement_reference (&comp -> on_release,
+ lease -> on_release,
+ "supersede_lease");
+ }
/* Record the lease in the uid hash if necessary. */
if (enter_uid && lease -> uid) {