From patchwork Tue Sep 29 17:34:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 523967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 93E9D140157 for ; Wed, 30 Sep 2015 03:44:28 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 8A805105AD; Tue, 29 Sep 2015 10:44:17 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 2034D1059D for ; Tue, 29 Sep 2015 10:44:16 -0700 (PDT) Received: from bar3.cudamail.com (bar1 [192.168.15.1]) by mx3v1.cudamail.com (Postfix) with ESMTP id 3E80F618C59 for ; Tue, 29 Sep 2015 11:44:15 -0600 (MDT) X-ASG-Debug-ID: 1443548654-03dd7b37dc44470001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar3.cudamail.com with ESMTP id R3jb7UmdEAJlm2oP (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 29 Sep 2015 11:44:14 -0600 (MDT) X-Barracuda-Envelope-From: shettyg@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-pa0-f50.google.com) (209.85.220.50) by mx3-pf3.cudamail.com with ESMTPS (RC4-SHA encrypted); 29 Sep 2015 17:44:11 -0000 Received-SPF: unknown (mx3-pf3.cudamail.com: Multiple SPF records returned) X-Barracuda-Apparent-Source-IP: 209.85.220.50 X-Barracuda-RBL-IP: 209.85.220.50 Received: by pacfv12 with SMTP id fv12so12500097pac.2 for ; Tue, 29 Sep 2015 10:44:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=BYZazUeYPk3z3dP7RJ5FlOkw8CVS+iqViXIa6dsO7ew=; b=kRadbqhmR1v++N/T50ncGN+c5ljzWBU/PzK9CMI7m8KbEMCmKaz0MxcZlA8rzgLsmL VFEyL+EYna0oj5vgeSX7SE4TwtF/R/8mVpDtzIwArKDA3+XExhE18JM9Hh/qUrSnOEIT zCP8aTr1AQeHK98XArq3VQqL6xiZdjrfcavXxvIKAjKVS7XgjTxZcZBvv+Df+4cnRzuU hJK9GIe2b2WCPt91xIWM7yxZDSA+MsNonH4laynFjNL9Uql+7fr54xn2Auxla26D8UFT 0X/TxGJRYt/sN8Urj5X01Y6xEC5MSWCTWm0vHcoq1BUE++/7hhe6w9EvT//ZdmYhb1X8 7K/Q== X-Gm-Message-State: ALoCoQmf/K65VhL2UVSCIpO0BDIQX7nceO1J7XNTcu5FKY1rmpUtPJ6PoIi75rFM4FgZZZgrTqsB X-Received: by 10.66.145.97 with SMTP id st1mr33993798pab.145.1443548652663; Tue, 29 Sep 2015 10:44:12 -0700 (PDT) Received: from htb-1n-eng-dhcp378.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id zk9sm26863926pac.7.2015.09.29.10.44.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Sep 2015 10:44:12 -0700 (PDT) X-CudaMail-Envelope-Sender: shettyg@nicira.com From: Gurucharan Shetty X-Google-Original-From: Gurucharan Shetty To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-928048442 X-CudaMail-DTE: 092915 X-CudaMail-Originating-IP: 209.85.220.50 Date: Tue, 29 Sep 2015 10:34:06 -0700 X-ASG-Orig-Subj: [##CM-V3-928048442##][PATCH 2/3] ovn-controller: Fix a case wherein tag can be zero. Message-Id: <1443548047-13144-2-git-send-email-gshetty@nicira.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443548047-13144-1-git-send-email-gshetty@nicira.com> References: <1443548047-13144-1-git-send-email-gshetty@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1443548654 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH 2/3] ovn-controller: Fix a case wherein tag can be zero. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" If the ovn-nb DB's logical_port table is populated such that tag is zero, we should not consider that record. Signed-off-by: Gurucharan Shetty Acked-by: Russell Bryant --- ovn/controller/physical.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c index f57acbc..5280916 100644 --- a/ovn/controller/physical.c +++ b/ovn/controller/physical.c @@ -253,9 +253,12 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve, } ofport = u16_to_ofp(simap_get(&localnet_to_ofport, network)); } else if (binding->parent_port) { + if (!binding->tag || !*binding->tag) { + continue; + } ofport = u16_to_ofp(simap_get(&localvif_to_ofport, binding->parent_port)); - if (ofport && binding->tag) { + if (ofport) { tag = *binding->tag; } } else {