From: Al Viro Date: Sat, 11 Jul 2020 00:10:34 +0000 (-0400) Subject: icmp_push_reply(): reorder adding the checksum up X-Git-Tag: v5.15~2737^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ea7ca80d9c0ff606b5a129dce2354f771a9e4e8;p=platform%2Fkernel%2Flinux-starfive.git icmp_push_reply(): reorder adding the checksum up do csum_partial_copy_nocheck() on the first fragment, then add the rest to it. Equivalent transformation. That was the only caller of csum_partial_copy_nocheck() that might pass it non-zero as the last argument. Signed-off-by: Al Viro --- diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index d15f780..e23dd5f 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -376,15 +376,15 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, ip_flush_pending_frames(sk); } else if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) { struct icmphdr *icmph = icmp_hdr(skb); - __wsum csum = 0; + __wsum csum; struct sk_buff *skb1; + csum = csum_partial_copy_nocheck((void *)&icmp_param->data, + (char *)icmph, + icmp_param->head_len, 0); skb_queue_walk(&sk->sk_write_queue, skb1) { csum = csum_add(csum, skb1->csum); } - csum = csum_partial_copy_nocheck((void *)&icmp_param->data, - (char *)icmph, - icmp_param->head_len, csum); icmph->checksum = csum_fold(csum); skb->ip_summed = CHECKSUM_NONE; ip_push_pending_frames(sk, fl4);