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 C8DE2A04A6; Wed, 9 Feb 2022 10:39:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C17F4115A; Wed, 9 Feb 2022 10:39:19 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 17A6641151; Wed, 9 Feb 2022 10:39:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644399557; x=1675935557; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MJIbxPsHl9uJCJHSXuUW9z34Sa73O/Grx2Pj8Y8TqgY=; b=D4SwvSsKfvRHV/le4d+hw035ZfgetXJ6f5Z5UJCd/TATSU9txaxD7J6U CwhVIsI6jOw2fhX6ab6fz4O5txNa++wtTtsXEPLf7DH0Vg9SsUFWNAweW px72cQ1brNBMRveBtjTs3LSnCV7WOEw3rf6u15/01ind4VtzrTbbu9Ppi l1Xr8Oe/74828pVx36zjKiN9m4hhO63hsqQcJ81oOUAdMNgNOwt0G0To2 otX+8gdCmQss/t1b7n86U4c3gIrt+4BWJsXrpSCG7XETvVJbap1r9Fp7p s5As0NBiT+THZx53/xsqjjZ/91Sh+XLzwDOKVVLCbtH9kzOeU2HxUHXDE Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10252"; a="229137250" X-IronPort-AV: E=Sophos;i="5.88,355,1635231600"; d="scan'208";a="229137250" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 01:39:16 -0800 X-IronPort-AV: E=Sophos;i="5.88,355,1635231600"; d="scan'208";a="525924996" Received: from intel-cd-odc-gavin.cd.intel.com ([10.240.178.138]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 01:39:13 -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 v5 2/6] net: fix L2TPv2 common header Date: Wed, 9 Feb 2022 17:38:53 +0800 Message-Id: <20220209093857.79364-3-jie1x.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220209093857.79364-1-jie1x.wang@intel.com> References: <20220208083849.510136-1-jie1x.wang@intel.com> <20220209093857.79364-1-jie1x.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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. For L2TP reference: https://datatracker.ietf.org/doc/html/rfc2661#section-3.1 Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol") Cc: stable@dpdk.org Signed-off-by: Jie Wang Acked-by: Ori Kam Acked-by: Ferruh Yigit --- 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