ICMP messages contain checksums: https://www.rfc-editor.org/rfc/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.
ICMP messages contain checksums: https://www.rfc-editor.org/rfc/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
.
If you just want to see the algorithm for the checksum, check the source code for unsigned short in_cksum
and following.