From: Eric Dumazet Date: Tue, 11 Oct 2022 21:27:28 +0000 (-0700) Subject: ipv6: ping: fix wrong checksum for large frames X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=87445f369cca2965620e79f87145d3d7fa35befd;p=linux.git ipv6: ping: fix wrong checksum for large frames For a given ping datagram, ping_getfrag() is called once per skb fragment. A large datagram requiring more than one page fragment is currently getting the checksum of the last fragment, instead of the cumulative one. After this patch, "ping -s 35000 ::1" is working correctly. Fixes: 6d0bfe226116 ("net: ipv6: Add IPv6 support to the ping socket.") Signed-off-by: Eric Dumazet Cc: Lorenzo Colitti Cc: Maciej Żenczykowski Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 517042caf6dc1..705672f319e16 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -639,7 +639,7 @@ int ping_getfrag(void *from, char *to, * wcheck, it will be finalized in ping_v4_push_pending_frames. */ if (pfh->family == AF_INET6) { - skb->csum = pfh->wcheck; + skb->csum = csum_block_add(skb->csum, pfh->wcheck, odd); skb->ip_summed = CHECKSUM_NONE; pfh->wcheck = 0; }