PatchSet : 8540 Branch : MAIN Author : ralf Date : 2005/09/20 10:56:26 (1127213786) Revisions : include/asm-mips/checksum.h : 1.30->1.31 Log: 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 cvs -q -d /home/cvs rdiff -u -kk -r 1.30 -r 1.31 linux/include/asm-mips/checksum.h Index: linux/include/asm-mips/checksum.h diff -u linux/include/asm-mips/checksum.h:1.30 linux/include/asm-mips/checksum.h:1.31 --- linux/include/asm-mips/checksum.h:1.30 Thu Jul 14 13:05:08 2005 +++ linux/include/asm-mips/checksum.h Tue Sep 20 11:56:26 2005 @@ -149,7 +149,7 @@ " daddu %0, %4 \n" " dsll32 $1, %0, 0 \n" " daddu %0, $1 \n" - " dsrl32 %0, %0, 0 \n" + " dsra32 %0, %0, 0 \n" #endif " .set pop" : "=r" (sum)