Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
UDP calculated checksum 0 should be set as 0xFFFF in the frame #160
As per RFC 768, if the calculated UDP checksum is 0, it should be instead set as 0xFFFF in the frame. A value of 0 in the checksum field indicates to the receiver that no checksum was calculated and hence it should not verify the checksum.
Reported on the mailing list -
If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic). An all zero transmitted checksum value means that the transmitter generated no checksum (for debugging or for higher level protocols that don't care).
It took me a long time trying to identify where my Library code was wrong and the result is simply no error at all, it is just a question to add a final check of this UDP checksum Rule.
Just as extra info this rule is not applicable to TCP checksum, which is OK to be 0x0000.
For those who want to know the checksum algorithm in C, see RFC1071 https://tools.ietf.org/html/rfc1071