From patchwork Fri Mar 3 09:37:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: nickcooper-zhangtonghao X-Patchwork-Id: 734984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vZPHQ6WF7z9s7c for ; Fri, 3 Mar 2017 20:37:54 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 59156B2E; Fri, 3 Mar 2017 09:37:52 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 6ACD7941 for ; Fri, 3 Mar 2017 09:37:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 6A84BA1 for ; Fri, 3 Mar 2017 09:37:46 +0000 (UTC) X-QQ-mid: bizesmtp1t1488533859t34flqbmc Received: from local.opencloud.tech.localdomai (unknown [106.120.127.11]) by esmtp4.qq.com (ESMTP) with id ; Fri, 03 Mar 2017 17:37:39 +0800 (CST) X-QQ-SSF: 01100000002000F0FF70B00A0000000 X-QQ-FEAT: NviVax2pLsUp4iCmWdH2zbOF2vJuz4pgJUgYoyh+Hn0LRJMTZy1hGwtdLyTTD BC5EDhkwJOXbOydTDA2fa05HUJD4RkLWgF9atS+oCd2oqdhTpmdGF1Z5wzI2Aq/lx5N7MXj /r6mdcM+nL9LW0NBcZjPgfpu5kXfBCcqyuWgw4q2p+2JD1LVNSi0HqTRYfKT05VLx6or60c EvDD7hwhaKEYl6MxxGXf+1gAWM4j/dRAVRJGl285ui30ZVUBEDtLBQLpKhtXggoX427N5Uk SHnJsO4UDUW8XV X-QQ-GoodBg: 0 From: nickcooper-zhangtonghao To: dev@openvswitch.org Date: Fri, 3 Mar 2017 01:37:21 -0800 Message-Id: <1488533841-87647-2-git-send-email-nic@opencloud.tech> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1488533841-87647-1-git-send-email-nic@opencloud.tech> References: <1488533841-87647-1-git-send-email-nic@opencloud.tech> X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 2/2] mcast-snooping: Avoid segfault for vswitchd. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 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. or ofputil_port_to_string(ofbundle_get_a_port(bundle)->up.ofp_port, Signed-off-by: nickcooper-zhangtonghao --- ofproto/ofproto-dpif.c | 1 + 1 file changed, 1 insertion(+) 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);