From: Ben Pfaff Date: Wed, 11 Mar 2009 22:38:22 +0000 (-0700) Subject: vswitch: Don't delete all flows on SIGHUP if a controller is configured. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f37fdff2f6de7e81559424efae4286c49d3bad7;p=openvswitch vswitch: Don't delete all flows on SIGHUP if a controller is configured. This was intended to only take effect when we had been running standalone and were now connecting to a controller, but the test was reversed. Instead of just reversing the test, this change also deletes flows when we switch from connected to standalone as well. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index e37e6856..56689b58 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -840,6 +840,13 @@ bridge_reconfigure_one(struct bridge *br) ctl = controller ? xstrdup(controller) : NULL; } + /* Delete all flows if we're switching from connected to standalone or vice + * versa. (XXX Should we delete all flows if we are switching from one + * controller to another?) */ + if ((br->controller != NULL) != (ctl != NULL)) { + ofproto_flush_flows(br->ofproto); + } + if (ctl) { const char *fail_mode; @@ -918,13 +925,6 @@ bridge_reconfigure_one(struct bridge *br) } else { ofproto_set_remote_execution(br->ofproto, NULL, NULL); } - - if (br->controller) { - /* Get rid of our match-everything flow, and all the rest while - * we're at it (which should mostly be subflows set up by that - * one). */ - ofproto_flush_flows(br->ofproto); - } } else { union ofp_action action; flow_t flow;