From patchwork Wed Jul 12 22:47:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 787448 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 3x7DcV1b5Gz9s06 for ; Thu, 13 Jul 2017 08:47:54 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id BEAEEAB2; Wed, 12 Jul 2017 22:47:13 +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 13E38A81 for ; Wed, 12 Jul 2017 22:47:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9C30FE4 for ; Wed, 12 Jul 2017 22:47:12 +0000 (UTC) Received: from mfilter14-d.gandi.net (mfilter14-d.gandi.net [217.70.178.142]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 7DE17FB8A9 for ; Thu, 13 Jul 2017 00:47:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter14-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter14-d.gandi.net (mfilter14-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id hRIhDvZ9c1nD for ; Thu, 13 Jul 2017 00:47:09 +0200 (CEST) X-Originating-IP: 208.91.2.4 Received: from localhost.localdomain (unknown [208.91.2.4]) (Authenticated sender: jpettit@ovn.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 67D89FB89E for ; Thu, 13 Jul 2017 00:47:09 +0200 (CEST) From: Justin Pettit To: dev@openvswitch.org Date: Wed, 12 Jul 2017 15:47:07 -0700 Message-Id: <1499899627-49634-1-git-send-email-jpettit@ovn.org> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW 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] nx-match: Don't append "ct_nw_proto" nx_match if mask not set. 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 function nx_put_raw() shouldn't append "ct_nw_proto" to nx_match if the corresponding mask isn't set. Signed-off-by: Justin Pettit Acked-by: Ben Pfaff --- lib/nx-match.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/nx-match.c b/lib/nx-match.c index cb0cad8458b9..c64953b8892b 100644 --- a/lib/nx-match.c +++ b/lib/nx-match.c @@ -1190,7 +1190,9 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match, nxm_put_ipv6(&ctx, MFF_CT_IPV6_DST, oxm, &flow->ct_ipv6_dst, &match->wc.masks.ct_ipv6_dst); if (flow->ct_nw_proto) { - nxm_put_8(&ctx, MFF_CT_NW_PROTO, oxm, flow->ct_nw_proto); + if (match->wc.masks.ct_nw_proto) { + nxm_put_8(&ctx, MFF_CT_NW_PROTO, oxm, flow->ct_nw_proto); + } nxm_put_16m(&ctx, MFF_CT_TP_SRC, oxm, flow->ct_tp_src, match->wc.masks.ct_tp_src); nxm_put_16m(&ctx, MFF_CT_TP_DST, oxm,