diff mbox series

[net-next] crypto/chcr: fix incorrect ipv6 packet length

Message ID 20200330161122.15314-1-rohitm@chelsio.com
State Accepted
Delegated to: David Miller
Headers show
Series [net-next] crypto/chcr: fix incorrect ipv6 packet length | expand

Commit Message

Rohit Maheshwari March 30, 2020, 4:11 p.m. UTC
IPv6 header's payload length field shouldn't include IPv6 header length.

Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
---
 drivers/crypto/chelsio/chcr_ktls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller March 30, 2020, 5:41 p.m. UTC | #1
From: Rohit Maheshwari <rohitm@chelsio.com>
Date: Mon, 30 Mar 2020 21:41:22 +0530

> IPv6 header's payload length field shouldn't include IPv6 header length.
> 
> Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/crypto/chelsio/chcr_ktls.c b/drivers/crypto/chelsio/chcr_ktls.c
index 00099e793e63..73658b71d4a3 100644
--- 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_ktls_info *tx_info, struct sk_buff *skb,
 		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