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.
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;
} 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;