ipv6: Paritially checksum full MTU frames
authorVlad Yasevich <vyasevich@gmail.com>
Mon, 30 Jan 2017 03:52:53 +0000 (22:52 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Jan 2017 20:51:12 +0000 (15:51 -0500)
IPv6 will mark data that is smaller that mtu - headersize as
CHECKSUM_PARTIAL, but if the data will completely fill the mtu,
the packet checksum will be computed in software instead.
Extend the conditional to include the data that fills the mtu
as well.

Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c

index 2c0df09e90365ad38b5362f77c6e33a24fc062f0..b6a94ff0bbd0d5f42c78b7bcd6ea9fbe5ac9a595 100644 (file)
@@ -1344,7 +1344,7 @@ emsgsize:
         */
        if (transhdrlen && sk->sk_protocol == IPPROTO_UDP &&
            headersize == sizeof(struct ipv6hdr) &&
-           length < mtu - headersize &&
+           length <= mtu - headersize &&
            !(flags & MSG_MORE) &&
            rt->dst.dev->features & (NETIF_F_IPV6_CSUM | NETIF_F_HW_CSUM))
                csummode = CHECKSUM_PARTIAL;