From 952efc486da04bcb8c9d6ad01383e28632b7d140 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Tue, 30 Jun 2009 15:24:54 -0700 Subject: [PATCH] vswitch: Set minimum probe interval to 5 seconds 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 | 1 + vswitchd/bridge.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/secchan/status.c b/secchan/status.c index 1dedb8df..c7598f37 100644 --- a/secchan/status.c +++ b/secchan/status.c @@ -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)); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 0d9e49b3..ba905287 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -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) { -- 2.30.2