From: Ben Pfaff Date: Thu, 5 Mar 2009 20:29:02 +0000 (-0800) Subject: ofproto: Make ofproto_set_controller() able to disconnect from controller. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec7c9b2e14196860b00d16d977a6b527619f673d;p=openvswitch ofproto: Make ofproto_set_controller() able to disconnect from controller. The vswitch wants to do this. --- diff --git a/secchan/ofproto.c b/secchan/ofproto.c index 9c54830a..00f71731 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -389,9 +389,12 @@ ofproto_set_controller(struct ofproto *ofproto, const char *controller) { if (ofproto->discovery) { return EINVAL; + } else if (controller) { + return rconn_connect(ofproto->controller->rconn, controller); + } else { + rconn_disconnect(ofproto->controller->rconn); + return 0; } - rconn_connect(ofproto->controller->rconn, controller); - return 0; } int