summaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2021-06-10 15:49:34 -0700
committerBen Pfaff <blp@ovn.org>2021-07-02 10:59:50 -0700
commit10c9dfeb53bee05d80ae2132ab6efa35955b229a (patch)
tree7ae83e23c29b7a58aeb3cbbeb0895cc913bcf347 /vswitchd
parent8d7c240835cf116b0c3c0b8413af1f00ca51ba9a (diff)
downloadopenvswitch-10c9dfeb53bee05d80ae2132ab6efa35955b229a.tar.gz
bridge: Only an inactivity_probe of 0 should turn off inactivity probes.
The documentation for inactivity_probe says this: inactivity_probe: optional integer Maximum number of milliseconds of idle time on connec‐ tion to controller before sending an inactivity probe message. If Open vSwitch does not communicate with the controller for the specified number of seconds, it will send a probe. If a response is not received for the same additional amount of time, Open vSwitch assumes the con‐ nection has been broken and attempts to reconnect. De‐ fault is implementation-specific. A value of 0 disables inactivity probes. This means that a value of 0 should disable inactivity probes and any other value should be in milliseconds. The code in bridge.c was actually interpreting it as any value between 0 and 999 disabling inactivity probes. That was surprising when I accidentally configured it to 5 or to 10, not remembering that it was in milliseconds, and disabled them entirely. This fixes the problem. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 2591e29d8..7f3bdc294 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -3965,8 +3965,10 @@ bridge_configure_remotes(struct bridge *br,
*oc = (struct ofproto_controller) {
.type = get_controller_ofconn_type(c->target, c->type),
.max_backoff = c->max_backoff ? *c->max_backoff / 1000 : 8,
- .probe_interval = (c->inactivity_probe
- ? *c->inactivity_probe / 1000 : 5),
+ .probe_interval = (!c->inactivity_probe ? 5
+ : !*c->inactivity_probe ? 0
+ : *c->inactivity_probe < 1000 ? 1
+ : *c->inactivity_probe / 1000),
.band = ((!c->connection_mode
|| !strcmp(c->connection_mode, "in-band"))
&& !disable_in_band