From: Justin Pettit Date: Fri, 13 Mar 2009 00:32:33 +0000 (-0700) Subject: Don't send mgmt OpenFlow messages if mgmt_rconn isn't set. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09d0a5285d69035c52309bee7d5b54e224a24c67;p=openvswitch Don't send mgmt OpenFlow messages if mgmt_rconn isn't set. In some circumstances we try to send a configuration update to the controller, regardless of whether we're actually connected. This fixes that and warns if others try to do similar things. --- diff --git a/vswitchd/mgmt.c b/vswitchd/mgmt.c index 4e1130c7..22eaf7e8 100644 --- a/vswitchd/mgmt.c +++ b/vswitchd/mgmt.c @@ -162,7 +162,7 @@ mgmt_reconfigure(void) * resent automatically. If we're not reconnecting and the * config file has changed, we need to notify the controller of * changes. */ - if (cfg_updated) { + if (cfg_updated && mgmt_rconn) { send_config_update(0, false); } return; @@ -223,6 +223,11 @@ send_openflow_buffer(struct ofpbuf *buffer) { int retval; + if (!mgmt_rconn) { + VLOG_ERR("attempt to send openflow packet with no rconn\n"); + return EINVAL; + } + update_openflow_length(buffer); retval = rconn_send_with_limit(mgmt_rconn, buffer, txqlen, TXQ_LIMIT); if (retval) {