From: David Hankins Date: Wed, 20 May 2009 23:58:53 +0000 (+0000) Subject: - Fixed a bug where an OMAPI socket disconnection message would not result X-Git-Tag: v4_2_0a1~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=350576c5d44ddfd9b08dadfe41f4015a9593d170;p=thirdparty%2Fdhcp.git - Fixed a bug where an OMAPI socket disconnection message would not result in scheduling a failover reconnection, if the link had not negotiated a failover connect yet (e.g.: connection refused, asynch socket connect() timeouts). [ISC-Bugs #19684] --- diff --git a/RELNOTES b/RELNOTES index 118ad8e35..466a5dbf8 100644 --- a/RELNOTES +++ b/RELNOTES @@ -127,6 +127,11 @@ work on other platforms. Please report any problems and suggested fixes to that probably still resulted in the correct behaviour (but wouldn't use a larger defined value provided by the host OS). +- Fixed a bug where an OMAPI socket disconnection message would not result + in scheduling a failover reconnection, if the link had not negotiated a + failover connect yet (e.g.: connection refused, asynch socket connect() + timeouts). + Changes since 4.1.0b1 - A missing "else" in dhcrelay.c could have caused an interface not to diff --git a/server/failover.c b/server/failover.c index 462655ca2..773f1e7a0 100644 --- a/server/failover.c +++ b/server/failover.c @@ -328,22 +328,19 @@ isc_result_t dhcp_failover_link_signal (omapi_object_t *h, link -> state = dhcp_flink_disconnected; /* Make the transition. */ - if (state -> link_to_peer == link) { - dhcp_failover_state_transition (link -> state_object, - name); + if (state->link_to_peer == link) + dhcp_failover_state_transition(link->state_object, name); - /* Start trying to reconnect. */ + /* Schedule an attempt to reconnect. */ #if defined (DEBUG_FAILOVER_TIMING) - log_info ("add_timeout +5 %s", - "dhcp_failover_reconnect"); + log_info("add_timeout +5 dhcp_failover_reconnect"); #endif - tv . tv_sec = cur_time + 5; - tv . tv_usec = 0; - add_timeout (&tv, dhcp_failover_reconnect, - state, - (tvref_t)dhcp_failover_state_reference, - (tvunref_t)dhcp_failover_state_dereference); - } + tv.tv_sec = cur_time + 5; + tv.tv_usec = cur_tv.tv_usec; + add_timeout(&tv, dhcp_failover_reconnect, state, + (tvref_t)dhcp_failover_state_reference, + (tvunref_t)dhcp_failover_state_dereference); + dhcp_failover_state_dereference (&state, MDL); } return ISC_R_SUCCESS;