Received: from eggs.gnu.org ([2001:4830:134:3::10]:52414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhE7N-0002YW-DE for qemu-devel@nongnu.org; Tue, 06 Sep 2016 07:00:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhE7I-0001QV-6y for qemu-devel@nongnu.org; Tue, 06 Sep 2016 07:00:40 -0400 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]:35487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhE7H-0001QJ-OX for qemu-devel@nongnu.org; Tue, 06 Sep 2016 07:00:36 -0400 Received: by mail-pa0-x233.google.com with SMTP id b2so1452713pat.2 for ; Tue, 06 Sep 2016 04:00:35 -0700 (PDT) References: <20160906125510-mutt-send-email-mst@kernel.org> From: Alexey Kardashevskiy Message-ID: <3863996b-e42d-b824-cdb3-caaaf6d6364f@ozlabs.ru> Date: Tue, 6 Sep 2016 21:00:30 +1000 MIME-Version: 1.0 In-Reply-To: <20160906125510-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] virtio-net & dhcp & udp checksum List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: "qemu-devel@nongnu.org" On 06/09/16 20:03, Michael S. Tsirkin wrote: > On Tue, Sep 06, 2016 at 02:32:27PM +1000, Alexey Kardashevskiy wrote: >> Hi! >> >> I am trying DHCP between 2 guests. So I am running first guest with: >> >> -netdev tap,id=TAP0,helper=/home/aik/qemu-bridge-helper \ >> -device "virtio-net-pci,id=vnet0,mac=C0:41:49:4b:ee:ee,netdev=TAP0" >> >> and second one with: >> >> -netdev tap,id=TAP0,vhost=on,helper=/home/aik/qemu-bridge-helper \ >> -device "virtio-net-pci,id=vnet0,mac=C0:41:49:4b:00:01,netdev=TAP0" \ >> >> >> Both tap are connected to br0 on the host: >> >> aik@fstn1-p1:~$ brctl show >> bridge name bridge id STP enabled interfaces >> br0 8000.fe397c73cecc no tap0 >> tap1 >> >> Both guests are debian8 with v4.7 kernel, one is running Dnsmasq version >> 2.72, the other - isc-dhclient-4.3.1. >> >> The very first response from dnsmasq has a bad UDP checksum: >> >> 04:19:04.946754 c0:41:49:4b:ee:ee > c0:41:49:4b:00:01, ethertype IPv4 (0x0800) >> , length 346: (tos 0xc0, ttl 64, id 60635, offset 0, flags [none], proto UDP ( >> 17), length 332) >> 192.168.1.250.67 > 192.168.1.1.68: [bad udp cksum 0x8595 -> 0x6e44!] BOOTP >> /DHCP, Reply, length 304, xid 0x38e6b51c, Flags [none] (0x0000) >> >> 0x8595 looks like a UDP header checksum. Unlike dhclient (which uses >> PF_PACKET), dnsmasq seems to use AF_INET and DGRAM so I am wondering what >> exactly should do this checksum calculations in this case and why it does >> not do this? > > Receiver should - the packet is clearly marked as such. Where is that mark exactly? UDP header (unlikely)? IP header (cannot see it)? DHCP? > Of course old dhclient ignores this flag. I think Debian used to > carry a patch to make it take it into account. So seeing bad UDP checksum message in tcpdump of the _source_ (dnsmasq's tap) side is ok? >> >> I read the old discussion at >> http://www.mail-archive.com/kvm@vger.kernel.org/msg41958.html >> >> but it seems that in my case the broken thing is dnsmasq (which is hard to >> believe). Running the dnsmasq's guest with >> >> -device virtio-net-pci,id=vnet0,csum=off,... >> >> fixes the problem. >> >> What is broken now? Thanks. > > Maybe debian dropped the patch from dhcp? > http://marc.info/?l=kvm&m=129347023113779 > > Or you can use the host-side workaround using a checksum rule. Sure, I am just trying to educate myself and understand what to expect and what is broken :) -- Alexey