vswitch: Set minimum probe interval to 5 seconds
authorJustin Pettit <jpettit@nicira.com>
Tue, 30 Jun 2009 22:24:54 +0000 (15:24 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 30 Jun 2009 22:24:54 +0000 (15:24 -0700)
In vSwitch, the minimum probe interval is supposed to be 5 seconds, but
that was not enforced.  If no interval was specified in the config file,
a value of 0 was being used, which would cause probes to never be sent
and the rconn not to move out of its ACTIVE state.

Possible fix to Bug #1466.

secchan/status.c
vswitchd/bridge.c

index 1dedb8dfe28d52a30f01ce4f8df18595ef8184a8..c7598f37ba6a3564abdbaeab47b5557ba2fe33b9 100644 (file)
@@ -96,6 +96,7 @@ rconn_status_cb(struct status_reply *sr, void *rconn_)
     status_reply_put(sr, "name=%s", rconn_get_name(rconn));
     status_reply_put(sr, "state=%s", rconn_get_state(rconn));
     status_reply_put(sr, "backoff=%d", rconn_get_backoff(rconn));
+    status_reply_put(sr, "probe-interval=%d", rconn_get_probe_interval(rconn));
     status_reply_put(sr, "is-connected=%s",
                      rconn_is_connected(rconn) ? "true" : "false");
     status_reply_put(sr, "sent-msgs=%u", rconn_packets_sent(rconn));
index 0d9e49b30ff47e61cfdd13c6f0a9a343c63ac30c..ba9052872a70325a260dd82f938496d773a50cb6 100644 (file)
@@ -1131,8 +1131,13 @@ bridge_reconfigure_controller(struct bridge *br)
                              || !strcmp(fail_mode, "open")));
 
         probe = cfg_get_int(0, "%s.inactivity-probe", pfx);
-        ofproto_set_probe_interval(br->ofproto,
-                                   probe ? probe : cfg_get_int(0, "mgmt.inactivity-probe"));
+        if (probe < 5) {
+            probe = cfg_get_int(0, "mgmt.inactivity-probe");
+            if (probe < 5) {
+                probe = 15;
+            }
+        }
+        ofproto_set_probe_interval(br->ofproto, probe);
 
         max_backoff = cfg_get_int(0, "%s.max-backoff", pfx);
         if (!max_backoff) {