Blob Blame History Raw
From: Rohit Maheshwari <rohitm@chelsio.com>
Date: Mon, 30 Mar 2020 21:41:22 +0530
Subject: crypto/chcr: fix incorrect ipv6 packet length
Patch-mainline: v5.7-rc1
Git-commit: e14394e656855c218c0c6cf918c550d5fdc1401d
References: jsc#SLE-15131

IPv6 header's payload length field shouldn't include IPv6 header length.

Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/crypto/chelsio/chcr_ktls.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/crypto/chelsio/chcr_ktls.c
+++ b/drivers/crypto/chelsio/chcr_ktls.c
@@ -981,7 +981,7 @@ chcr_ktls_write_tcp_options(struct chcr_
 		ip->tot_len = htons(pktlen - maclen);
 	} else {
 		ip6 = (struct ipv6hdr *)(buf + maclen);
-		ip6->payload_len = htons(pktlen - maclen);
+		ip6->payload_len = htons(pktlen - maclen - iplen);
 	}
 	/* now take care of the tcp header, if fin is not set then clear push
 	 * bit as well, and if fin is set, it will be sent at the last so we