From patchwork Mon Sep 9 10:02:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1159654 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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 46RkHy25SBz9sNF for ; Mon, 9 Sep 2019 20:03:09 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 64561E7A; Mon, 9 Sep 2019 10:03:06 +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 9E719E6F for ; Mon, 9 Sep 2019 10:03:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 52BCA7DB for ; Mon, 9 Sep 2019 10:03:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6BAB410F2E80; Mon, 9 Sep 2019 10:03:03 +0000 (UTC) Received: from nummac.local (dhcp35-127.lab.eng.blr.redhat.com [10.70.35.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0738610018F8; Mon, 9 Sep 2019 10:03:01 +0000 (UTC) From: nusiddiq@redhat.com To: dev@openvswitch.org Date: Mon, 9 Sep 2019 15:32:45 +0530 Message-Id: <20190909100245.14160-1-nusiddiq@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Mon, 09 Sep 2019 10:03:03 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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] Fix the segfault seen in ovn-controller when running tests 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: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Numan Siddique The test case - "116: ovn -- 2 HVs, 2 lports/HV, localnet ports, DVR N-S Ping" is failing with the segfault in ovn-controller occationally. This patch fixes it. backtrace ------ Program terminated with signal SIGSEGV, Segmentation fault. 0x0000000000422414 in put_remote_port_redirect_bridged (...) at /usr/include/bits/byteswap.h:52 52 return __builtin_bswap32 (__bsx); [Current thread is 1 (Thread 0x7f985fbe04c0 (LWP 18625))] ------ Fixes: 03493b33c073("OVN: Vlan backed DVR N-S, redirect packet via localnet port") CC: Ankur Sharma Signed-off-by: Numan Siddique Acked-by: Lorenzo Bianconi --- controller/physical.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controller/physical.c b/controller/physical.c index c818646f0..f28c5f078 100644 --- a/controller/physical.c +++ b/controller/physical.c @@ -272,6 +272,9 @@ put_remote_port_redirect_bridged(const struct const struct sbrec_port_binding *ls_localnet_port; ls_localnet_port = get_localnet_port(local_datapaths, ls_dp_key); + if (!ls_localnet_port) { + return; + } src_mac = ofpact_put_SET_ETH_SRC(ofpacts_p); src_mac->mac = binding_mac;