summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2001-01-19 11:10:32 +0000
committerTed Lemon <source@isc.org>2001-01-19 11:10:32 +0000
commite7bd704742f90f6af4864dd2ebc6e02e5061fede (patch)
tree147e540ded58bb477bc9d8e341248f86276eee9f
parent54bdf6c75ecc3e8b1baf65f1739bc59721cbad7c (diff)
downloadisc-dhcp-e7bd704742f90f6af4864dd2ebc6e02e5061fede.tar.gz
Do not delete a client's DNS entry on entry to a transitory state (e.g., expired).
-rw-r--r--server/mdb.c44
1 files changed, 35 insertions, 9 deletions
diff --git a/server/mdb.c b/server/mdb.c
index 2e089c39..07f50592 100644
--- a/server/mdb.c
+++ b/server/mdb.c
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
-"$Id: mdb.c,v 1.49 2001/01/06 21:39:30 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
+"$Id: mdb.c,v 1.50 2001/01/19 11:10:32 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -1061,13 +1061,30 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
void process_state_transition (struct lease *lease)
{
+#if defined (FAILOVER_PROTOCOL)
+ dhcp_failover_state_t *peer;
+
+ if (lease && lease -> pool && lease -> pool -> failover_peer)
+ peer = lease -> pool -> failover_peer;
+ else
+ peer = (dhcp_failover_state_t *)0;
+#endif
+
/* If the lease was active and is now no longer active, but isn't
released, then it just expired, so do the expiry event. */
if (lease -> next_binding_state != lease -> binding_state &&
- (lease -> binding_state == FTS_ACTIVE ||
- lease -> binding_state == FTS_BOOTP ||
- lease -> binding_state == FTS_RESERVED) &&
- lease -> next_binding_state != FTS_RELEASED) {
+ ((
+#if defined (FAILOVER_PROTOCOL)
+ peer &&
+ lease -> binding_state == FTS_EXPIRED &&
+ (lease -> next_binding_state == FTS_FREE ||
+ lease -> next_binding_state == FTS_BACKUP)) ||
+ (!peer &&
+#endif
+ (lease -> binding_state == FTS_ACTIVE ||
+ lease -> binding_state == FTS_BOOTP ||
+ lease -> binding_state == FTS_RESERVED) &&
+ lease -> next_binding_state != FTS_RELEASED))) {
ddns_removals (lease);
if (lease -> on_expiry) {
execute_statements ((struct binding_value **)0,
@@ -1092,10 +1109,19 @@ void process_state_transition (struct lease *lease)
/* If the lease was active and is now released, do the release
event. */
- if ((lease -> binding_state == FTS_ACTIVE ||
- lease -> binding_state == FTS_BOOTP ||
- lease -> binding_state == FTS_RESERVED) &&
- lease -> next_binding_state == FTS_RELEASED) {
+ if (lease -> next_binding_state != lease -> binding_state &&
+ ((
+#if defined (FAILOVER_PROTOCOL)
+ peer &&
+ lease -> binding_state == FTS_RELEASED &&
+ (lease -> next_binding_state == FTS_FREE ||
+ lease -> next_binding_state == FTS_BACKUP)) ||
+ (!peer &&
+#endif
+ (lease -> binding_state == FTS_ACTIVE ||
+ lease -> binding_state == FTS_BOOTP ||
+ lease -> binding_state == FTS_RESERVED) &&
+ lease -> next_binding_state == FTS_RELEASED))) {
ddns_removals (lease);
if (lease -> on_release) {
execute_statements ((struct binding_value **)0,