netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: "Thomas B. =?UTF-8?B?UsO8Y2tlciI=?= <dm8tbr@openpma.org>"@smtp.osdl.org
Cc: netdev@vger.kernel.org, "Philipp Gühring" <pg@futureware.at>
Subject: Re: UDP checksum broken since 2.6.18?
Date: Tue, 22 May 2007 16:12:17 -0700	[thread overview]
Message-ID: <20070522161217.20875c39@freepuppy> (raw)
In-Reply-To: <465364EA.3020100@openpma.org>

On Tue, 22 May 2007 21:47:22 +0000
"Thomas B. Rücker" <dm8tbr@openpma.org> wrote:

> hi,
> 
> a friend of mine recently contacted me about what he at first thought
> were IPv6 issues with some java software.
> 
> As it turns out it probably is a general IP issue with the Linux kernel:
> 
> He wrote this piece of c which sends an UDP packet to 127.28.50.50 -
> http://www2.futureware.at/~philipp/udp-problem.c
> Packets generated by this code were captured by tcpdump and wireshark.
> When feeding the dump into wireshark it says:
> "Checksum: 0x62fd [incorrect, should be 0xe4f3]" for the udp packet.
> 
> We've tested this on several kernel versions.
> Wireshark reports checksum broken:
> Linux version 2.6.18-4-vserver-686 (Debian 2.6.18.dfsg.1-12)
> (waldi@debian.org) (gcc version 4.1.2 20061115 (prerelease) (Debian
> 4.1.1-21)) #1 SMP Mon Mar 26 19:55:22 UTC 2007
> Linux version 2.6.19-dm8tbr-1 (root@oberon) (gcc version 4.1.2 20061028
> (prerelease) (Debian 4.1.1-19)) #3 SMP PREEMPT Sun Dec 3 18:31:00 CET
> 2006 - (that's vanilla)
> Linux version 2.6.21.1-dm8tbr-1 (root@oberon) (gcc version 4.1.2
> 20061115 (prerelease) (Debian 4.1.1-21)) #3 SMP Fri May 18 09:04:55 CEST
> 2007 - (that's vanilla + dscape patch)
> 
> Wireshark reports checksum ok:
> Linux version 2.6.16.13-4-default (geeko@buildhost) (gcc version 4.1.0
> (SUSE Linux)) #1 Wed May 3 04:53:23 UTC 2006
> Linux version 2.6.17-11-386 (root@terranova) (gcc version 4.1.2 20060928
> (prerelease) (Ubuntu 4.1.1-13ubuntu5)) #2 Tue Mar 13 23:30:30 UTC 2007
> (Ubuntu 2.6.17-11.37-386)
> 
> So my guess is something between 2.6.17 and 2.6.18 broke.
> 
> Second option is: The way you are supposed to send UDP packets changed
> in 2.6.18 and sun javavm and that piece of c are broken for the same reason.
> 
> Third option: everything is perfectly ok, the UDP checksum is computed
> in a different way since 2.6.18 - due to some reason I don't know - and
> Wireshark is broken.
> 
> We'd be grateful for some enlightment.
> 
> Cheers
> 
> Thomas
>

The packet passed to packet capture programs may not have a valid checksum
if you have checksum offload configured on the device.  What kind of hardware
do you have on sender and receiver?  Try disabling checksum offload with
ethtool.

If you are getting bad UDP checksums then the counters in 'netstat -s'
will be increasing.

  reply	other threads:[~2007-05-22 23:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-22 21:47 UDP checksum broken since 2.6.18? "Thomas B. Rücker"
2007-05-22 23:12 ` Stephen Hemminger [this message]
2007-05-22 23:33   ` "Thomas B. Rücker"
2007-05-23 10:01     ` Herbert Xu
2007-05-23 10:33       ` "Thomas B. Rücker"
2007-05-23 11:50         ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070522161217.20875c39@freepuppy \
    --to=shemminger@linux-foundation.org \
    --cc="Thomas B. =?UTF-8?B?UsO8Y2tlciI=?= <dm8tbr@openpma.org>"@smtp.osdl.org \
    --cc=netdev@vger.kernel.org \
    --cc=pg@futureware.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).