From 504884dd7f306f5fbfb69dfa0318b1febf2dd486 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 5 Mar 2009 12:28:36 -0800 Subject: [PATCH] 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. --- secchan/ofproto.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 -- 2.30.2