From: Ted Lemon Date: Wed, 20 Sep 2000 09:06:39 +0000 (+0000) Subject: - When partner disconnects (or stops responding to keepalives), try X-Git-Tag: V3-BETA-2-PATCH-5^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db6960a7fa0c7e87ceeae09d0c54bbec0b2e3f10;p=thirdparty%2Fdhcp.git - When partner disconnects (or stops responding to keepalives), try to reconnect. --- diff --git a/server/failover.c b/server/failover.c index 2deb0f2f2..7ef1eebed 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; }