From mboxrd@z Thu Jan 1 00:00:00 1970 From: aviadye@dev.mellanox.co.il Subject: [PATCH 09/11] examples/ipsec-secgw: Fixed ip length in case of transport Date: Sat, 14 Oct 2017 16:28:01 +0300 Message-ID: <1507987683-12315-9-git-send-email-aviadye@dev.mellanox.co.il> References: <1507987683-12315-1-git-send-email-aviadye@dev.mellanox.co.il> 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 To: dev@dpdk.org, sergio.gonzalez.monroy@intel.com, pablo.de.lara.guarch@intel.com, aviadye@mellanox.com Return-path: 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) In-Reply-To: <1507987683-12315-1-git-send-email-aviadye@dev.mellanox.co.il> 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 --- 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); -- 2.7.4