From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: UDP checksum broken since 2.6.18? Date: Tue, 22 May 2007 16:12:17 -0700 Message-ID: <20070522161217.20875c39@freepuppy> References: <465364EA.3020100@openpma.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: netdev@vger.kernel.org, Philipp =?UTF-8?B?R8O8aHJpbmc=?= To: "Thomas B. =?UTF-8?B?UsO8Y2tlciI=?= "@smtp.osdl.org Return-path: Received: from smtp.osdl.org ([207.189.120.12]:48412 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760767AbXEVXOq convert rfc822-to-8bit (ORCPT ); Tue, 22 May 2007 19:14:46 -0400 In-Reply-To: <465364EA.3020100@openpma.org> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Tue, 22 May 2007 21:47:22 +0000 "Thomas B. R=C3=BCcker" wrote: > hi, >=20 > a friend of mine recently contacted me about what he at first thought > were IPv6 issues with some java software. >=20 > As it turns out it probably is a general IP issue with the Linux kern= el: >=20 > 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= =2E > When feeding the dump into wireshark it says: > "Checksum: 0x62fd [incorrect, should be 0xe4f3]" for the udp packet. >=20 > 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 200610= 28 > (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 C= EST > 2007 - (that's vanilla + dscape patch) >=20 > 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 20060= 928 > (prerelease) (Ubuntu 4.1.1-13ubuntu5)) #2 Tue Mar 13 23:30:30 UTC 200= 7 > (Ubuntu 2.6.17-11.37-386) >=20 > So my guess is something between 2.6.17 and 2.6.18 broke. >=20 > Second option is: The way you are supposed to send UDP packets change= d > in 2.6.18 and sun javavm and that piece of c are broken for the same = reason. >=20 > Third option: everything is perfectly ok, the UDP checksum is compute= d > in a different way since 2.6.18 - due to some reason I don't know - a= nd > Wireshark is broken. >=20 > We'd be grateful for some enlightment. >=20 > Cheers >=20 > Thomas > The packet passed to packet capture programs may not have a valid check= sum if you have checksum offload configured on the device. What kind of ha= rdware do you have on sender and receiver? Try disabling checksum offload wit= h ethtool. If you are getting bad UDP checksums then the counters in 'netstat -s' will be increasing.