From patchwork Thu Dec 10 02:27:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniele Di Proietto X-Patchwork-Id: 554975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id E5BE0140E5E for ; Thu, 10 Dec 2015 13:27:38 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 32361106FE; Wed, 9 Dec 2015 18:27:21 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 59AD7106BD for ; Wed, 9 Dec 2015 18:27:19 -0800 (PST) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id B0AE11E00E9 for ; Wed, 9 Dec 2015 19:27:18 -0700 (MST) X-ASG-Debug-ID: 1449714438-09eadd16a83e4700001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id YCZCf4dV5y6NQpJi (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 09 Dec 2015 19:27:18 -0700 (MST) X-Barracuda-Envelope-From: diproiettod@vmware.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO smtp-outbound-2.vmware.com) (208.91.2.13) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 10 Dec 2015 02:27:18 -0000 Received-SPF: error (mx1-pf1.cudamail.com: error in processing during lookup of vmware.com: DNS problem) X-Barracuda-Apparent-Source-IP: 208.91.2.13 X-Barracuda-RBL-IP: 208.91.2.13 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 37977281EB for ; Wed, 9 Dec 2015 18:27:16 -0800 (PST) Received: from sc9-mailhost2.vmware.com (unknown [10.33.74.48]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 671D2185A0; Wed, 9 Dec 2015 18:27:17 -0800 (PST) X-CudaMail-Envelope-Sender: diproiettod@vmware.com From: Daniele Di Proietto To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-1208109540 X-CudaMail-DTE: 120915 X-CudaMail-Originating-IP: 208.91.2.13 Date: Wed, 9 Dec 2015 18:27:39 -0800 X-ASG-Orig-Subj: [##CM-E1-1208109540##][PATCH 6/9] odp-util: Correctly [de]serialize mask for ND attributes. Message-Id: <1449714462-31831-7-git-send-email-diproiettod@vmware.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449714462-31831-1-git-send-email-diproiettod@vmware.com> References: <1449714462-31831-1-git-send-email-diproiettod@vmware.com> X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1449714438 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 X-ASG-Whitelist: EmailCat (corporate) Subject: [ovs-dev] [PATCH 6/9] odp-util: Correctly [de]serialize mask for ND attributes. 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" When converting between ODP attributes and struct flow_wildcards, we check that all the prerequisites are exact matched on the mask. For ND(ICMPv6) attributes, an exact match on tp_src and tp_dst (which in this context are the icmp type and code) shold look like htons(0xff), not htons(0xffff). Fix this in two places. The consequences were that the datapath wouldn't match on the ND attributes, and the flow would get revalidated away. Signed-off-by: Daniele Di Proietto Acked-by: Jarno Rajahalme --- lib/odp-util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/odp-util.c b/lib/odp-util.c index 3717aee..fbc0788 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -4358,8 +4358,8 @@ odp_flow_key_from_flow__(const struct odp_flow_key_parms *parms, if (flow->tp_dst == htons(0) && (flow->tp_src == htons(ND_NEIGHBOR_SOLICIT) || flow->tp_src == htons(ND_NEIGHBOR_ADVERT)) - && (!export_mask || (data->tp_src == htons(0xffff) - && data->tp_dst == htons(0xffff)))) { + && (!export_mask || (data->tp_src == htons(0xff) + && data->tp_dst == htons(0xff)))) { struct ovs_key_nd *nd_key; @@ -4905,8 +4905,8 @@ parse_l2_5_onward(const struct nlattr *attrs[OVS_KEY_ATTR_MAX + 1], flow->arp_tha = nd_key->nd_tll; if (is_mask) { if (!is_all_zeros(nd_key, sizeof *nd_key) && - (flow->tp_src != htons(0xffff) || - flow->tp_dst != htons(0xffff))) { + (flow->tp_src != htons(0xff) || + flow->tp_dst != htons(0xff))) { return ODP_FIT_ERROR; } else { expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_ND;