crypto/chcr: fix incorrect ipv6 packet length
authorRohit Maheshwari <rohitm@chelsio.com>
Mon, 30 Mar 2020 16:11:22 +0000 (21:41 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Mar 2020 17:40:12 +0000 (10:40 -0700)
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>
drivers/crypto/chelsio/chcr_ktls.c

index 00099e793e631624efac78ee47a7a9933572c3d8..73658b71d4a3554a52525fc96313472a73d3beaf 100644 (file)
@@ -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