Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
ICMP messages contain checksums: https://tools.ietf.org/html/rfc792
Does ping validate the checksums when receiving an echo reply message?
I don't see a note about it in the man page.
I'm using Fedora 27.
Yes, it does.
From the source code:
csfailed = in_cksum((unsigned short *)icp, cc, 0);
Although it does not seem to check the csfailed when the icp->type == ICMP_ECHOREPLY.
icp->type == ICMP_ECHOREPLY
If you just want to see the algorithm for the checksum, check the source code for unsigned short in_cksum and following.
unsigned short in_cksum
Required, but never shown