The IPv4 header checksum is the one’s complement of the one’s complement sum of the header’s 16-bit words. Recomputing the sum over the whole header, checksum included, gives 0xFFFF when it is intact. It detects accidents, not attackers.