From ec7c9b2e14196860b00d16d977a6b527619f673d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 5 Mar 2009 12:29:02 -0800 Subject: [PATCH] ofproto: Make ofproto_set_controller() able to disconnect from controller. The vswitch wants to do this. --- secchan/ofproto.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.30.2