From db6960a7fa0c7e87ceeae09d0c54bbec0b2e3f10 Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Wed, 20 Sep 2000 09:06:39 +0000 Subject: [PATCH] - When partner disconnects (or stops responding to keepalives), try to reconnect. --- server/failover.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/server/failover.c b/server/failover.c index 2deb0f2f..7ef1eebe 100644 --- a/server/failover.c +++ b/server/failover.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: failover.c,v 1.25 2000/09/04 22:32:34 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: failover.c,v 1.26 2000/09/20 09:06:39 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -297,15 +297,20 @@ isc_result_t dhcp_failover_link_signal (omapi_object_t *h, if (!strcmp (name, "disconnect")) { if (link -> state_object && link -> state_object -> link_to_peer == link) { - if (link -> state_object -> i_am == primary) { - add_timeout (cur_time + 5, dhcp_failover_reconnect, - link -> state_object, - (tvref_t)dhcp_failover_state_reference, - (tvunref_t)dhcp_failover_state_dereference); - } + dhcp_failover_state_reference (&state, + link -> state_object, MDL); link -> state = dhcp_flink_disconnected; + /* Make the transition. */ dhcp_failover_state_transition (link -> state_object, name); + + /* Start trying to reconnect. */ + add_timeout (cur_time + 5, dhcp_failover_reconnect, + state, + (tvref_t)dhcp_failover_state_reference, + (tvunref_t)dhcp_failover_state_dereference); + + state_dereference (&state, MDL); } return ISC_R_SUCCESS; }