The vswitchd bridge code tries not to call this function if it doesn't
have to, but it's not doing a good job. We should fix it in vswitchd, but
it's also a good idea to do it here.
if (ofproto->discovery) {
return EINVAL;
} else if (controller) {
- return rconn_connect(ofproto->controller->rconn, controller);
+ if (strcmp(rconn_get_name(ofproto->controller->rconn), controller)) {
+ return rconn_connect(ofproto->controller->rconn, controller);
+ } else {
+ return 0;
+ }
} else {
rconn_disconnect(ofproto->controller->rconn);
return 0;