diff mbox

[ovs-dev,v2,2/2] mcast-snooping: Avoid segfault for vswitchd.

Message ID 1488534466-88049-2-git-send-email-nic@opencloud.tech
State Accepted
Headers show

Commit Message

nickcooper-zhangtonghao March 3, 2017, 9:47 a.m. UTC
The ports which are attached mrouters or hosts, were destroyed
by users via ovs-vsctl commands. Currently the vswitch will
segfault if users use "ovs-appctl mdb/show" to show mdb info.
This patch avoids a segfault.

    ofproto_unixctl_mcast_snooping_show ofproto/ofproto-dpif.c:4781
    process_command lib/unixctl.c:313
    run_connection lib/unixctl.c:347
    unixctl_server_run lib/unixctl.c:400
    main vswitchd/ovs-vswitchd.c:112

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
---
 ofproto/ofproto-dpif.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 366b7a2..1e1b107 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -2756,6 +2756,7 @@  bundle_destroy(struct ofbundle *bundle)
     }
 
     bundle_flush_macs(bundle, true);
+    mcast_snooping_flush_bundle(ofproto->ms, bundle);
     hmap_remove(&ofproto->bundles, &bundle->hmap_node);
     free(bundle->name);
     free(bundle->trunks);