| Summary: | in_cksum computes wrong checksum | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Jonathan Lemon <jlemon> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.0-CURRENT | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->closed Submitted has rescinded PR |
For some data patterns, in_cksum generates a checksum of 0. The specification says a checksum of 0 should be transmitted as all ones (65535), and a transmitted checksum of 0 indicates that the sender did not compute a checksum. While 0 == 65535 in 1's complement arithmetic, this is still wrong. The error was discovered while doing incremental checksum computations on the TCP stream on an intermediate machine. How-To-Repeat: tcpdump 'tcp[16:2] == 0', (dump TCP packets with a zero checksum) and transmit various TCP data streams.