From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 004FFA034D for ; Sat, 29 Jan 2022 07:25:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EAFAF4068A; Sat, 29 Jan 2022 07:25:40 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 29D294068A; Sat, 29 Jan 2022 07:25:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643437539; x=1674973539; h=from:to:cc:subject:date:message-id:in-reply-to: references:reply-to:mime-version: content-transfer-encoding; bh=Rq2lWX+Us10y20AkNhBW1lgUnPRAuG7mFCo/Lviepk4=; b=PcVgv+UiIz6rBZUtvouG0TP9uDRDdgJKm1+s25T3LVJOhVPk3Zsl++L3 akcytxpO3eyv8vkeiLHi0/luGWslzxHJxi3UdOBQjTmj6W+zBi5gaAIBV bBXL89urtWc/xUPVBSXUCmHlVDrw74fusQxtCj2K06iQc3EAjdXp3tzv7 +fmYrCsmHhyu2mMnkJr26/hDFf3VD5U3ZY57S83BfQ2Q3OUKUO1VEA74y 9VEZApGzPiMPXQMHfvlMdzePq3zWUU6/W0f7M3iD9cj4uSp0hFzKXJfh3 WEBYwVPaNm1U8FTzkHw+p7k1x+Yj+slZeEUAS9j18kAEQQsvUDwci2dzu w==; X-IronPort-AV: E=McAfee;i="6200,9189,10241"; a="244847712" X-IronPort-AV: E=Sophos;i="5.88,326,1635231600"; d="scan'208";a="244847712" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2022 22:25:37 -0800 X-IronPort-AV: E=Sophos;i="5.88,326,1635231600"; d="scan'208";a="496351932" Received: from intel-cd-odc-gavin.cd.intel.com ([10.240.178.183]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2022 22:25:34 -0800 From: Jie Wang To: dev@dpdk.org Cc: stevex.yang@intel.com, orika@nvidia.com, aman.deep.singh@intel.com, ferruh.yigit@intel.com, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com, olivier.matz@6wind.com, Jie Wang , stable@dpdk.org Subject: [PATCH v3 2/6] net: fix L2TPv2 common header Date: Sat, 29 Jan 2022 14:24:30 +0800 Message-Id: <20220129062434.2455711-3-jie1x.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220129062434.2455711-1-jie1x.wang@intel.com> References: <20220129062434.2455711-1-jie1x.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: 20220126063016.2384393-1-jie1x.wang@intel.com Errors-To: stable-bounces@dpdk.org The fields of L2TPv2 common header were reversed in big endian and little endian. This patch fixes this error to ensure L2TPv2 can be parsed correctly. Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol") Cc: stable@dpdk.org Signed-off-by: Jie Wang --- lib/net/rte_l2tpv2.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h index 938a993b48..1f3ad3f03c 100644 --- a/lib/net/rte_l2tpv2.h +++ b/lib/net/rte_l2tpv2.h @@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr { __extension__ struct { #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN - uint16_t t:1; /**< message Type */ - uint16_t l:1; /**< length option bit */ - uint16_t res1:2; /**< reserved */ - uint16_t s:1; /**< ns/nr option bit */ - uint16_t res2:1; /**< reserved */ - uint16_t o:1; /**< offset option bit */ - uint16_t p:1; /**< priority option bit */ - uint16_t res3:4; /**< reserved */ - uint16_t ver:4; /**< protocol version */ -#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN uint16_t ver:4; /**< protocol version */ uint16_t res3:4; /**< reserved */ uint16_t p:1; /**< priority option bit */ @@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr { uint16_t res1:2; /**< reserved */ uint16_t l:1; /**< length option bit */ uint16_t t:1; /**< message Type */ +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint16_t t:1; /**< message Type */ + uint16_t l:1; /**< length option bit */ + uint16_t res1:2; /**< reserved */ + uint16_t s:1; /**< ns/nr option bit */ + uint16_t res2:1; /**< reserved */ + uint16_t o:1; /**< offset option bit */ + uint16_t p:1; /**< priority option bit */ + uint16_t res3:4; /**< reserved */ + uint16_t ver:4; /**< protocol version */ #endif }; }; -- 2.25.1