From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: [PATCH] examples/ipsec-secgw: Update checksum while decrementing ttl Date: Mon, 26 Sep 2016 22:02:58 +0530 Message-ID: <20160926163300.22990-1-akhil.goyal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Akhil Goyal To: Return-path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0058.outbound.protection.outlook.com [104.47.34.58]) by dpdk.org (Postfix) with ESMTP id E6B313238 for ; Mon, 26 Sep 2016 13:05:04 +0200 (CEST) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Akhil Goyal In IPsec-secgw application when TTL is decremented in IP header before forwarding the packet, checksum needs to be updated. In this patch an incremental checksum is added. Other applications(like l3fwd) are also doing so. Signed-off-by: Akhil Goyal --- examples/ipsec-secgw/ipip.h | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/ipsec-secgw/ipip.h b/examples/ipsec-secgw/ipip.h index ff1dccd..ef059a9 100644 --- a/examples/ipsec-secgw/ipip.h +++ b/examples/ipsec-secgw/ipip.h @@ -56,6 +56,7 @@ ipip_outbound(struct rte_mbuf *m, uint32_t offset, uint32_t is_ipv6, if (inip4->ip_v == IPVERSION) { /* XXX This should be done by the forwarding engine instead */ inip4->ip_ttl -= 1; + inip4->ip_sum += 1; ds_ecn = inip4->ip_tos; } else { inip6 = (struct ip6_hdr *)inip4; -- 1.9.1