]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Fixed a bug where an OMAPI socket disconnection message would not result
authorDavid Hankins <dhankins@isc.org>
Wed, 20 May 2009 23:58:53 +0000 (23:58 +0000)
committerDavid Hankins <dhankins@isc.org>
Wed, 20 May 2009 23:58:53 +0000 (23:58 +0000)
  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]

RELNOTES
server/failover.c

index 118ad8e35134b3f7ee2415cc19462b8cda600cba..466a5dbf8c03ba7132dddefea12f9cf411a50041 100644 (file)
--- 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
index 462655ca2b0b6fd4cc7a53a04aad687bf0dc83f7..773f1e7a0b8ef24e553011644d7aaa76dfd12bde 100644 (file)
@@ -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;