[Top] [All Lists]

CVS linux

Subject: CVS linux
Date: Tue, 20 Sep 2005 11:58:56 +0100
CVSROOT:        /home/cvs
Module name:    linux
Changes by: 05/09/20 11:58:50

Modified files:
        include/asm-mips64: Tag: linux_2_4 checksum.h 

Log message:
        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 <>

diff -urN linux/include/asm-mips64/checksum.h 
--- linux/include/asm-mips64/Attic/checksum.h   2004/04/23 21:00:53
+++ linux/include/asm-mips64/Attic/checksum.h   2005/09/20 10:58:50
@@ -144,7 +144,7 @@
        "daddu\t%0, %4\n\t"
        "dsll32\t$1, %0, 0\n\t"
        "daddu\t%0, $1\n\t"
-       "dsrl32\t%0, %0, 0\n\t"
+       "dsra32\t%0, %0, 0\n\t"
        : "=&r" (sum)
        : "0" (daddr), "r"(saddr),

<Prev in Thread] Current Thread [Next in Thread>