From: David Stevens <[EMAIL PROTECTED]>
Date: Fri, 10 Nov 2006 09:54:58 -0800

> The Internet checksum is defined as a 1's-complement sum, so if  the
> alternate 0 does not have a special meaning in a protocol, then by
> 1's-complement arithmetic, 0 == ~0.
>         So, it looks to me without the remapping that a valid checksum
> may also fail, if it is simply computed in a different way (or on a 
> different
> architecture) such that one gets 0 and one gets ~0 as un-modified answers.
>         Since we're checking for equality on 2's-complement machines,
> I think the easiest thing is to still re-map it. Otherwise, instead of 
> testing
> for 0, we have to test for both 0 and ~0 in the validity checks, right?

Puzzling :-)  Then why is the transformation only performed for
UDP in the ipv4 stack?  It seems by your logic TCP would need
to either do the "if (sum==0) sum=~0;"  thing or it would need
to accept both "0" and "~0" in the checksum checking path.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to