]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Adjusted lease state validation checks in potential-conflict, to
authorDavid Hankins <dhankins@isc.org>
Fri, 30 Sep 2005 17:51:04 +0000 (17:51 +0000)
committerDavid Hankins <dhankins@isc.org>
Fri, 30 Sep 2005 17:51:04 +0000 (17:51 +0000)
  account for possible clock skew similarly to normal state, and several
  previously illegal transitions were made legal (ex: active->released).
  [ISC-Bugs #14834]

RELNOTES
server/failover.c

index 4ebcc062331633851c240bad1254cf3defc1e4df..9400e7ed32accca37ff83ce00d75e41ccb5ce675 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -95,6 +95,10 @@ and for prodding me into improving it.
 - Failover potential expiry calculations (TSTP) have been corrected.  Results
   should be substantially more consistent, and proper given the constraints.
 
+- Adjusted lease state validation checks in potential-conflict, to
+  account for possible clock skew similarly to normal state, and several
+  previously illegal transitions were made legal (ex: active->released).
+
                        Changes since 3.0.3b3
 
 - dhclient.conf documentation for interface {} was updated to reflect recent
index 49a36d811f3e79ea939aa099e82e710a7e893dfc..8ab2f33f61d25a32bb3f89ed08f4e06685dea476 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: failover.c,v 1.53.2.40 2005/09/22 16:19:59 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: failover.c,v 1.53.2.41 2005/09/30 17:51:04 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -5283,21 +5283,29 @@ conflict_binding_state_transition_check (struct lease *lease,
                        switch (binding_state) {
                              case FTS_FREE:
                              case FTS_BACKUP:
-                             case FTS_ABANDONED:
                                new_state = lease -> binding_state;
                                break;
 
                              case FTS_EXPIRED:
-                             case FTS_RELEASED:
-                             case FTS_RESET:
-                               if (lease -> ends > cur_time)
-                                       new_state =
-                                               lease -> binding_state;
+                               /* If we don't agree about expiry, it's
+                                * invalid.  65 should allow for max
+                                * clock skew (60) plus some fudge.
+                                * XXX: should we refetch cur_time?
+                                */
+                               if ((lease->ends - 65) > cur_time)
+                                       new_state = lease->binding_state;
                                else
                                        new_state = binding_state;
                                break;
 
-                             case FTS_ACTIVE:
+                               /* RELEASED, RESET, and ABANDONED indicate
+                                * that our partner has information about
+                                * this lease that we did not witness.  Our
+                                * partner wins.
+                                */
+                             case FTS_RELEASED:
+                             case FTS_RESET:
+                             case FTS_ABANDONED:
                                new_state = binding_state;
                                break;