From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 08BE7B432 for ; Thu, 9 Jun 2016 10:42:57 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 09 Jun 2016 01:42:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,443,1459839600"; d="scan'208";a="824710754" Received: from sie-lab-212-209.ir.intel.com (HELO silpixa00377983.ir.intel.com) ([10.237.212.209]) by orsmga003.jf.intel.com with ESMTP; 09 Jun 2016 01:42:55 -0700 From: Sergio Gonzalez Monroy To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, john.mcnamara@intel.com Date: Thu, 9 Jun 2016 09:42:42 +0100 Message-Id: <1465461770-42233-2-git-send-email-sergio.gonzalez.monroy@intel.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1465461770-42233-1-git-send-email-sergio.gonzalez.monroy@intel.com> References: <1463575330-8467-1-git-send-email-sergio.gonzalez.monroy@intel.com> <1465461770-42233-1-git-send-email-sergio.gonzalez.monroy@intel.com> Subject: [dpdk-dev] [PATCH v3 1/9] examples/ipsec-secgw: fix esp padding check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 08:42:58 -0000 Current code fails to correctly check padding sequence for inbound packets. Padding sequence starts on 1 but it checks for 0. Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application") Signed-off-by: Sergio Gonzalez Monroy --- examples/ipsec-secgw/esp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c index 0f6b33e..7dce78c 100644 --- a/examples/ipsec-secgw/esp.c +++ b/examples/ipsec-secgw/esp.c @@ -139,7 +139,7 @@ esp4_tunnel_inbound_post_crypto(struct rte_mbuf *m, struct ipsec_sa *sa, padding = pad_len - *pad_len; for (i = 0; i < *pad_len; i++) { - if (padding[i] != i) { + if (padding[i] != i + 1) { RTE_LOG(ERR, IPSEC_ESP, "invalid pad_len field\n"); return -EINVAL; } -- 2.5.5