linux-mips
[Top] [All Lists]

Re: [PATCH] Fix TCP/UDP checksums on the Broadcom SB-1

To: Daniel Jacobowitz <dan@debian.org>
Subject: Re: [PATCH] Fix TCP/UDP checksums on the Broadcom SB-1
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 20 Sep 2005 12:01:02 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <20050920032818.GA7199@nevyn.them.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20050920032818.GA7199@nevyn.them.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.1i
On Mon, Sep 19, 2005 at 11:28:18PM -0400, Daniel Jacobowitz wrote:

> 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.

Good catch.  And just to increase the func factor this bug did also apply
to 2.4.  Applied,

  Ralf

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