From patchwork Tue Dec 5 07:30:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 844624 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=) 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 3yrYMM40fGz9s7g for ; Tue, 5 Dec 2017 18:31:11 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 91E43DC9; Tue, 5 Dec 2017 07:31:07 +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 A394CCFE for ; Tue, 5 Dec 2017 07:31:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8C6DAEB for ; Tue, 5 Dec 2017 07:31:05 +0000 (UTC) X-Originating-IP: 98.234.50.139 Received: from localhost.localdomain (unknown [98.234.50.139]) (Authenticated sender: jpettit@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id B8BCE41C096; Tue, 5 Dec 2017 08:31:02 +0100 (CET) From: Justin Pettit To: dev@openvswitch.org, Alin Gabriel Serdean , Sairam Venugopal Date: Mon, 4 Dec 2017 23:30:15 -0800 Message-Id: <1512459015-18138-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] datapath-windows: Correct endianness for deleting zone. 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 zone Netlink attribute is supposed to be in network-byte order, but the Windows code for deleting conntrack entries was treating it as host-byte order. Found by inspection. Signed-off-by: Justin Pettit Acked-by: Sairam Venugopal --- datapath-windows/ovsext/Conntrack.c | 2 +- lib/netlink-conntrack.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c index 3203411a8b7a..edc0ec9c5324 100644 --- a/datapath-windows/ovsext/Conntrack.c +++ b/datapath-windows/ovsext/Conntrack.c @@ -1076,7 +1076,7 @@ OvsCtDeleteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, } if (ctAttrs[CTA_ZONE]) { - zone = NlAttrGetU16(ctAttrs[CTA_ZONE]); + zone = ntohs(NlAttrGetU16(ctAttrs[CTA_ZONE])); } status = OvsCtFlush(zone); diff --git a/lib/netlink-conntrack.c b/lib/netlink-conntrack.c index 1e1bb2f79d1d..3c651b6c856a 100644 --- a/lib/netlink-conntrack.c +++ b/lib/netlink-conntrack.c @@ -251,7 +251,7 @@ nl_ct_flush_zone(uint16_t flush_zone) nl_msg_put_nfgenmsg(&buf, 0, AF_UNSPEC, NFNL_SUBSYS_CTNETLINK, IPCTNL_MSG_CT_DELETE, NLM_F_REQUEST); - nl_msg_put_be16(&buf, CTA_ZONE, flush_zone); + nl_msg_put_be16(&buf, CTA_ZONE, htons(flush_zone)); err = nl_transact(NETLINK_NETFILTER, &buf, NULL); ofpbuf_uninit(&buf);