All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: xming <xmingske@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCHv2] vhost-net: add dhclient work-around from userspace
Date: Mon, 20 Sep 2010 22:59:35 +0200	[thread overview]
Message-ID: <20100920205935.GB1128@redhat.com> (raw)
In-Reply-To: <AANLkTi=3du3MB=GU8ODfebxVYAg1qapyhW8yxDTjoc20@mail.gmail.com>

On Mon, Sep 20, 2010 at 02:12:40PM +0200, xming wrote:
> Hi,
> 
> I think I am hitting this, in a weird way :D. Running 0.12.90,
> vhost_net and kernel 2.6.35.4, I have troubles to get dhcp clients to
> work except an old dhcp client "pump" seems to work out of the box.
> Below are the output of dhcpcd, isc's dhcp client and busybox' udhcpc.
> 
> My dhcp server is in a guest with vhost_net running dnsmasq. Clients
> which do not use vhost_net (plain virtio, e1000 and physical machines)
> do not have any problems. The dhcp server itself is a dhcp client and
> uses dhcpcd to get lease from ADSL modem w/o issues.
> When the dhcp server is not using vhost_net, then all clients can get a lease.
> 
> So my conclusion so far is that when the server is using vhost_net and
> clients are using vhost_net (and above mentioned software), then it's
> getting invalid/checksum error UDP. the only working DHCP client is
> pump.

Newer versions of dhclient should also be OK: they detect
that checksum is missing in the packet. Try it e.g. with
a recent fedora guest as a client.

To solve the problem for old clients, recent kernels and iptables have
support for CHECKSUM target.

You can use this target to compute and fill in the checksum in
a packet that lacks a checksum.

Typical expected use:
iptables -A POSTROUTING -t mangle -p udp --dport bootpc \
-j CHECKSUM --checksum-fill

libvirt will program these for you if it sets up the server,
maybe there needs a flag to tell it that server is local.

> # dhcpcd
> dhcpcd[9089]: version 5.2.7 starting
> dhcpcd[9089]: eth0: broadcasting for a lease
> dhcpcd[9089]: eth0: invalid UDP packet from 192.168.1.1
> dhcpcd[9089]: eth0: invalid UDP packet from 192.168.1.1
> dhcpcd[9089]: eth0: invalid UDP packet from 192.168.1.1
> dhcpcd[9089]: eth0: invalid UDP packet from 192.168.1.1
> dhcpcd[9089]: timed out
> dhcpcd[9089]: allowing 8 seconds for IPv4LL timeout
> dhcpcd[9089]: eth0: probing for an IPv4LL address
> dhcpcd[9089]: eth0: checking for 169.254.195.227
> dhcpcd[9089]: eth0: using IPv4LL address 169.254.195.227
> dhcpcd[9089]: forked to background, child pid 9109
> 
> # dhclient
> Internet Systems Consortium DHCP Client V3.1.2p1-Gentoo
> Copyright 2004-2009 Internet Systems Consortium.
> All rights reserved.
> For info, please visit http://www.isc.org/sw/dhcp/
> 
> Listening on LPF/eth0/00:16:3e:00:07:01
> Sending on   LPF/eth0/00:16:3e:00:07:01
> Sending on   Socket/fallback
> DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
> DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
> DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
> DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
> DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
> 5 bad udp checksums in 5 packets
> DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
> No DHCPOFFERS received.
> No working leases in persistent database - sleeping.
> 
> 
> # busybox udhcpc
> ### adapter index 2
> ### adapter hardware address 00:16:3e:00:07:01
> udhcpc (v1.13.2) started
> ### vfork'ing and execle'ing /usr/share/udhcpc/default.script
> udhcpc: exec /usr/share/udhcpc/default.script: No such file or directory
> ### entering raw listen mode
> ### opening raw socket on ifindex 2
> ### got raw socket fd 5
> ### attached filter to raw socket fd 5
> ### bound to raw socket fd 5
> ### adding option 0x35
> ### adding option 0x3d
> ### adding option 0x3c
> ### adding option 0x39
> Sending discover...
> ### Waiting on select...
> udhcpc: packet with bad UDP checksum received, ignoring
> ### Waiting on select...
> ### adding option 0x35
> ### adding option 0x3d
> ### adding option 0x3c
> ### adding option 0x39
> Sending discover...
> ### Waiting on select...
> udhcpc: packet with bad UDP checksum received, ignoring
> ### Waiting on select...
> ### adding option 0x35
> ### adding option 0x3d
> ### adding option 0x3c
> ### adding option 0x39
> Sending discover...
> ### Waiting on select...
> udhcpc: packet with bad UDP checksum received, ignoring
> ### Waiting on select...
> ### vfork'ing and execle'ing /usr/share/udhcpc/default.script
> udhcpc: exec /usr/share/udhcpc/default.script: No such file or directory
> ### Waiting on select...
> ### adding option 0x35
> ### adding option 0x3d
> ### adding option 0x3c
> ### adding option 0x39
> Sending discover...
> ### Waiting on select...
> udhcpc: packet with bad UDP checksum received, ignoring
> ### Waiting on select...
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-09-20 21:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-28 10:08 [PATCHv2] vhost-net: add dhclient work-around from userspace Michael S. Tsirkin
2010-06-28 10:08 ` Michael S. Tsirkin
2010-06-28 15:30 ` Michael S. Tsirkin
2010-06-28 22:19 ` Sridhar Samudrala
2010-06-29  6:55   ` Michael S. Tsirkin
2010-06-29  7:36 ` David Miller
2010-06-29 13:04   ` Michael S. Tsirkin
2010-06-30 21:30     ` David Miller
2010-06-30 22:08     ` Anthony Liguori
2010-06-30 22:31       ` Michael S. Tsirkin
2010-06-30 23:24         ` Anthony Liguori
2010-06-30 23:24           ` Anthony Liguori
2010-09-20 12:12           ` xming
2010-09-20 20:59             ` Michael S. Tsirkin [this message]
2010-09-21  8:27               ` xming
2010-09-26 18:01                 ` Michael S. Tsirkin
  -- strict thread matches above, loose matches on Subject: below --
2010-06-28 10:08 Michael S. Tsirkin
2010-06-28 10:08 Michael S. Tsirkin

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=20100920205935.GB1128@redhat.com \
    --to=mst@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=xmingske@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.