From: David Hankins Date: Fri, 30 Sep 2005 17:51:04 +0000 (+0000) Subject: - Adjusted lease state validation checks in potential-conflict, to X-Git-Tag: V3-0-4-BETA-1~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc5c3182b241c07103dc1b51bb067dcc94c0eefb;p=thirdparty%2Fdhcp.git - 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). [ISC-Bugs #14834] --- diff --git a/RELNOTES b/RELNOTES index 4ebcc0623..9400e7ed3 100644 --- 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 diff --git a/server/failover.c b/server/failover.c index 49a36d811..8ab2f33f6 100644 --- a/server/failover.c +++ b/server/failover.c @@ -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;