]> git.hungrycats.org Git - linux/commit
[PATCH] Fix IP checksum for SuSE 9.0 compiler
authorAndi Kleen <ak@muc.de>
Fri, 7 Nov 2003 08:32:55 +0000 (00:32 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 7 Nov 2003 08:32:55 +0000 (00:32 -0800)
commit6077b1d358b09e4fb02ac9d5a3bed4884f7afe86
treefab04f1281c9a1f1061a9e57c7121b28fbcd25e0
parent9399e05e65aae282679c86a15abe6df7a7d736cb
[PATCH] Fix IP checksum for SuSE 9.0 compiler

The hammer branch based gcc 3.3 in SuSE 9.0 has a more aggressive
optimizer. ip_send_check has this code:

iph->check = 0;
iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);

The new gcc optimizes the first store away because it doesn't know
that ip_fast_csum reads its input memory. This leads to occassionally
packets with wrong IP header checksum getting sent; this happens especially
with NFS. Fixing it in the constraints would have been ugly and probably
not future proof, so this patch just adds a memory clobber to ip_fast_csum.

For some reason the issue only hits in 2.6, we haven't seen it in 2.4.
Problem occurs on both i386 and x86-64.

Credit goes to Olaf Kirch for tracking this down.
include/asm-i386/checksum.h
include/asm-x86_64/checksum.h