From: Ben Pfaff <blp@nicira.com>
Date: Thu, 5 Mar 2009 20:28:36 +0000 (-0800)
Subject: ofproto: Change semantics of configuration parameters.
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=504884dd7f306f5fbfb69dfa0318b1febf2dd486;p=openvswitch

ofproto: Change semantics of configuration parameters.

Before, a value of 0 meant "no change".  Now, it means "use the default
value".  This turns out to be more useful.
---

diff --git a/secchan/ofproto.c b/secchan/ofproto.c
index c466ce3d..9c54830a 100644
--- a/secchan/ofproto.c
+++ b/secchan/ofproto.c
@@ -302,20 +302,18 @@ ofproto_set_datapath_id(struct ofproto *p, uint64_t datapath_id)
 void
 ofproto_set_probe_interval(struct ofproto *p, int probe_interval)
 {
-    if (probe_interval) {
-        rconn_set_probe_interval(p->controller->rconn, probe_interval);
-        if (p->fail_open) {
-            fail_open_set_trigger_duration(p->fail_open, probe_interval * 3);
-        }
+    probe_interval = probe_interval ? MAX(probe_interval, 5) : 0;
+    rconn_set_probe_interval(p->controller->rconn, probe_interval);
+    if (p->fail_open) {
+        int trigger_duration = probe_interval ? probe_interval * 3 : 15;
+        fail_open_set_trigger_duration(p->fail_open, trigger_duration);
     }
 }
 
 void
 ofproto_set_max_backoff(struct ofproto *p, int max_backoff)
 {
-    if (max_backoff) {
-        rconn_set_max_backoff(p->controller->rconn, max_backoff);
-    }
+    rconn_set_max_backoff(p->controller->rconn, max_backoff);
 }
 
 void