]> git.baikalelectronics.ru Git - kernel.git/commit
The type of sum in csum_tcpudp_nofold is "unsigned int", so when we assign
authorRalf Baechle <ralf@linux-mips.org>
Tue, 20 Sep 2005 10:56:26 +0000 (10:56 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 29 Oct 2005 18:32:25 +0000 (19:32 +0100)
commit29b65dfd8dcee461247bbd8bf205249534266bf9
tree5a40713cc8ceec43a9ed0d2f02373a1e5a2d648f
parent721d432724dbcd6f13207777ad4b26e97300a6ca
The type of sum in csum_tcpudp_nofold is "unsigned int", so when we assign
to it in an asm() block, and we're running on a system with 64-bit
registers, it is vitally important that we sign extend it correctly before
returning to C.  Otherwise the stray high bits will be preserved into
csum_fold, and on the SB-1 processor, 32-bit arithmetic on a non
sign-extended register will yield surprising results.

This caused incorrect checksums in some UDP packets for NFS root.  The
problem was mild when using a 10.0.1.x IP address, but severe when
using 192.168.1.x.

Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
include/asm-mips/checksum.h