Thread (15 messages) 15 messages, 5 authors, 2014-10-01

RE: How exactly does CHECKSUM_COMPLETE works?

From: Yuval Mintz <hidden>
Date: 2014-10-01 05:17:34

quoted
Or looking back on the IPv4/TCP scenario, what exactly is the csum now
protecting?
Assume the HW passes the one's complement sum of the entire data, IP
header and onward to driver, which sets it in SKB->csum and marks the
SKB as CHECKSUM_COMPLETE.
In practice, SKB->csum should now equal to the one's complement of the
TCP pseudo header; But other than the length of data in the TCP header
and payload that pseudo-header doesn't include any information about
the payload itself.
But it does, as you pointed out the checksum calculation was performed over
the whole payload. The fact that the computed checksum equals the one's
complement of pseudo header is the indication that the checksum is valid. If
there were a bit corruption, the computed value would be different (summing in
pseudo header checksum would result in non-zero value).
Thanks, I've already reached that conclusion myself
[even wrote an E-mail; but it got blocked for some reason].
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help