linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Tue, 20 Sep 2005 11:56:33 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/09/20 11:56:27

Modified files:
        include/asm-mips: 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 <dan@codesourcery.com>

diff -urN linux/include/asm-mips/checksum.h linux/include/asm-mips/checksum.h
--- linux/include/asm-mips/checksum.h   2005/07/14 12:05:08     1.30
+++ linux/include/asm-mips/checksum.h   2005/09/20 10:56:26     1.31
@@ -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)

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