From bacf1b7bb8555c407d065e97015319abef2a742d Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 4 Apr 2024 21:17:39 +0200 Subject: [PATCH 1/1] ping: fix IPv4 checksum check always succeeding once again This issue was fixed once already in commit bff65fbb6f73 ("fix checksum always success in IPv4 ping."), but was reverted shortly after, likely due to a botched rebase. Fix this issue again, so ping correctly reports checksum mismatches in ICMP ECHO replies. This time it was found with barebox v2024.03.0 (or older) which has broken checksum on a Raspberry Pi 3b and ping its network interface (checksum mismatch verified by Wireshark). Closes: https://github.com/iputils/iputils/pull/534 Fixes: 8b8686794f69 ("warnings: remove variable shadowing") Reviewed-by: Petr Vorel Signed-off-by: Ahmad Fatoum Reference:https://github.com/iputils/iputils/commit/bacf1b7bb8555c407d065e97015319abef2a742d Conflict:NA --- ping/ping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ping/ping.c b/ping/ping.c index d0803fe..1a3e52c 100644 --- a/ping/ping.c +++ b/ping/ping.c @@ -1654,7 +1654,7 @@ int ping4_parse_reply(struct ping_rts *rts, struct socket_st *sock, wrong_source = 1; if (gather_statistics(rts, (uint8_t *)icp, sizeof(*icp), cc, ntohs(icp->un.echo.sequence), - reply_ttl, 0, tv, pr_addr(rts, from, sizeof *from), + reply_ttl, csfailed, tv, pr_addr(rts, from, sizeof *from), pr_echo_reply, rts->multicast, wrong_source)) { fflush(stdout); return 0; -- 2.33.0