From owner-freebsd-current@FreeBSD.ORG Fri Jan 7 10:06:23 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B849B106564A for ; Fri, 7 Jan 2011 10:06:23 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 5A1E48FC17 for ; Fri, 7 Jan 2011 10:06:23 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.4/8.14.4/NETPLEX) with ESMTP id p079mTlD014768 for ; Fri, 7 Jan 2011 04:48:29 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.6 (mail.netplex.net [204.213.176.10]); Fri, 07 Jan 2011 04:48:29 -0500 (EST) Date: Fri, 7 Jan 2011 04:48:29 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: freebsd-current@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: UDP checksum broken, -head and releng_8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 10:06:23 -0000 When sending multicast packets to a socket that is _not_ bound to the multicast address, this generates bad UDP checksums. This use to work and was broke sometime between the middle of October and late December as far as I can tell. A test program is here: http://people.freebsd.org/~deischen/test_net.c It will use multicast with the -b option, so run it with something like this: test_net -b 225.168.2.50 -p 5000 -m 64 And on another box, use tcpdump to see the bad checksums, as in: tcpdump -x -s0 -vvv host 225.168.2.50 and port 5000 This is a real problem for us because our applications cannot read the multicast data (both the Solaris and VxWork stacks refuse to deliver the packets with bad checksums). As a data point, if the sending socket is bound to the multicast address, then the checksums are calculated correctly. It is only if the socket is bound to a different address (the host IP and ephemeral port), that the checksum is invalid. To see this, you can change line 827 in test_net.c from this: if ((ss = init_mcast_socket(p, mcast_addr, if_addr, 1, 0)) < 0) to if ((ss = init_mcast_socket(p, mcast_addr, if_addr, 1, 1)) < 0) Here's a snippet from a tcpdump showing the problem: 04:46:13.640846 IP (tos 0x0, ttl 1, id 42777, offset 0, flags [none], proto UDP (17), length 92) 192.168.3.85.60133 > 225.168.2.50.5000: [bad udp cksum 3c02!] UDP, length 64 0x0000: 4500 005c a719 0000 0111 6aa0 c0a8 0355 0x0010: e1a8 0232 eae5 1388 0048 1cc6 0000 0038 0x0020: 0000 0018 0000 0000 0000 0000 0000 0000 0x0030: 0000 0000 0000 0000 0000 0000 0000 0000 0x0040: 0000 0000 0000 0000 0000 0000 0000 0000 0x0050: 0000 0000 0000 0000 0000 0000 04:46:13.741800 IP (tos 0x0, ttl 1, id 42778, offset 0, flags [none], proto UDP (17), length 92) 192.168.3.85.60133 > 225.168.2.50.5000: [bad udp cksum 3c02!] UDP, length 64 0x0000: 4500 005c a71a 0000 0111 6a9f c0a8 0355 0x0010: e1a8 0232 eae5 1388 0048 c76f 0000 0038 0x0020: 0000 0019 5555 5555 5555 5555 5555 5555 0x0030: 5555 5555 5555 5555 5555 5555 5555 5555 0x0040: 5555 5555 5555 5555 5555 5555 5555 5555 0x0050: 5555 5555 5555 5555 5555 5555 -- DE