]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Don't ignore 'no-op' peer state changes when we're disconnected.
authorTed Lemon <source@isc.org>
Fri, 20 Apr 2001 18:48:25 +0000 (18:48 +0000)
committerTed Lemon <source@isc.org>
Fri, 20 Apr 2001 18:48:25 +0000 (18:48 +0000)
server/failover.c

index e1a2911eee06a4e20903a209dc3778ce021c0dce..5d4d6da5d0cd84c94c5ce781dfa7d31e3e38dab7 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: failover.c,v 1.47 2001/04/20 18:34:27 mellon Exp $ Copyright (c) 1999-2001 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: failover.c,v 1.48 2001/04/20 18:48:25 mellon Exp $ Copyright (c) 1999-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1673,10 +1673,29 @@ isc_result_t dhcp_failover_peer_state_changed (dhcp_failover_state_t *state,
        new_state = msg -> server_state;
        startupp = (msg -> server_flags & FTF_STARTUP) ? 1 : 0;
 
-       if (state -> partner.state == new_state) {
-               if (state -> me.state == startup)
+       if (state -> partner.state == new_state && state -> me.state) {
+               switch (state -> me.state) {
+                     case startup:
                        dhcp_failover_set_state (state, state -> saved_state);
-               return ISC_R_SUCCESS;
+                       return ISC_R_SUCCESS;
+
+                     case unknown_state:
+                     case normal:
+                     case potential_conflict:
+                     case recover:
+                     case recover_done:
+                     case shut_down:
+                     case paused:
+                     case recover_wait:
+                       return ISC_R_SUCCESS;
+
+                       /* If we get a peer state change when we're
+                          disconnected, we always process it. */
+                     case partner_down:
+                     case communications_interrupted:
+                     case resolution_interrupted:
+                       break;
+               }
        }
 
        state -> partner.state = new_state;