aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Atteka <aatteka@nicira.com>2012-04-06 17:52:56 -0700
committerAnsis Atteka <aatteka@nicira.com>2012-04-10 11:37:02 -0700
commit613bded455dfed2755c4f734baf2f8ecb046c9ae (patch)
treecd837ad071f6ae69beeb426b0ba050cfbd4dddc1
parenta3edfc39a77445f18c69347dc51f8e7c722fa6e5 (diff)
vswitchd: Remove port from datapath if it becomes non-operational
If kernel module rejects config changes then vswitchd sets the ofport column to -1, but does not remove the non-operational port from the datapath. This patch fixes this problem. ovs-vsctl add-br ovsbr ovs-vsctl add-port ovsbr p1 ovs-vsctl add-port ovsbr p2 ovs-vsctl set Interface p1 options:remote_ip=2.1.1.1 options:key=123 type=gre ovs-vsctl set Interface p2 options:remote_ip=1.1.1.1 options:key=123 type=gre ovs-vsctl set Interface p2 options:remote_ip=2.1.1.1 options:key=123 type=gre ovs-dpctl show #observe that p2 does not appear here anymore Signed-off-by: Ansis Atteka <aatteka@nicira.com>
-rw-r--r--vswitchd/bridge.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index e09b552a..261fe24f 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1194,6 +1194,11 @@ bridge_add_ofproto_ports(struct bridge *br)
/* We already reported a related error, don't bother
* duplicating it. */
}
+ if (!ofproto_port_query_by_name(br->ofproto, port->name,
+ &ofproto_port)) {
+ ofproto_port_del(br->ofproto, ofproto_port.ofp_port);
+ ofproto_port_destroy(&ofproto_port);
+ }
iface_clear_db_record(iface->cfg);
iface_destroy(iface);
}