Closed green-nsk closed 9 months ago
Closing as invalid. As per the above spec, transmitting a checksum of 0 is valid (at least for IPv4) in cases where the protocol does not need a checksum. The only time you would do this is the COMPUTED checksum is zero.
I'll update my reasoning. A one's complement checksum will never be 0. A 0 value will become 0xffff. Therefore this change is redundant.
#define CHECKSUM_CARRY(x) (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff))
I assume the whole point of computing the checksum it to transmit non-null value. Otherwise you could as well return 0;
, it would also be technically valid
https://www.ietf.org/rfc/rfc768.txt