From patchwork Sat Oct 14 13:28:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aviad Yehezkel X-Patchwork-Id: 30400 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F21D81B6AC; Sat, 14 Oct 2017 15:28:20 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 613561B626 for ; Sat, 14 Oct 2017 15:28:09 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from aviadye@dev.mellanox.co.il) with ESMTPS (AES256-SHA encrypted); 14 Oct 2017 15:28:03 +0200 Received: from l-vmw-rdcore-205.mtl.labs.mlnx (l-vmw-rdcore-205.mtl.labs.mlnx [10.7.66.205]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v9EDS3RN026787; Sat, 14 Oct 2017 16:28:03 +0300 From: aviadye@dev.mellanox.co.il To: dev@dpdk.org, sergio.gonzalez.monroy@intel.com, pablo.de.lara.guarch@intel.com, aviadye@mellanox.com Cc: borisp@mellanox.com, akhil.goyal@nxp.com, hemant.agrawal@nxp.com, radu.nicolau@intel.com, declan.doherty@intel.com, aviadye@dev.mellanox.co.il, liranl@mellanox.com, nelio.laranjeiro@6wind.com, thomas@monjalon.net Date: Sat, 14 Oct 2017 16:28:01 +0300 Message-Id: <1507987683-12315-9-git-send-email-aviadye@dev.mellanox.co.il> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507987683-12315-1-git-send-email-aviadye@dev.mellanox.co.il> References: <1507987683-12315-1-git-send-email-aviadye@dev.mellanox.co.il> Subject: [dpdk-dev] [PATCH 09/11] examples/ipsec-secgw: Fixed ip length in case of transport X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Aviad Yehezkel IP length was incorrect causing corrupted ICMP packets for example Signed-off-by: Aviad Yehezkel Tested-by: Aviad Yehezkel --- examples/ipsec-secgw/esp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c index 81ebf55..12c6f8c 100644 --- a/examples/ipsec-secgw/esp.c +++ b/examples/ipsec-secgw/esp.c @@ -205,13 +205,13 @@ esp_inbound_post(struct rte_mbuf *m, struct ipsec_sa *sa, if (likely(ip->ip_v == IPVERSION)) { memmove(ip4, ip, ip->ip_hl * 4); ip4->ip_p = *nexthdr; - ip4->ip_len = htons(rte_pktmbuf_data_len(m)); + ip4->ip_len = htons(rte_pktmbuf_pkt_len(m)); } else { ip6 = (struct ip6_hdr *)ip4; /* XXX No option headers supported */ memmove(ip6, ip, sizeof(struct ip6_hdr)); ip6->ip6_nxt = *nexthdr; - ip6->ip6_plen = htons(rte_pktmbuf_data_len(m)); + ip6->ip6_plen = htons(rte_pktmbuf_pkt_len(m)); } } else ipip_inbound(m, sizeof(struct esp_hdr) + sa->iv_len);