All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"anthony@codemonkey.ws" <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH 2/6] slirp: Fix assertion failure on rejected DHCP requests
Date: Mon, 27 Feb 2012 14:58:07 +0100	[thread overview]
Message-ID: <4F4B8BEF.7010500@siemens.com> (raw)
In-Reply-To: <1330043012-30556-3-git-send-email-david@gibson.dropbear.id.au>

On 2012-02-24 01:23, David Gibson wrote:
> The guest network stack might DHCPREQUEST an address that the slirp built
> in dhcp server can't let it have - for example if the guest has an old
> leases file from another network configuration.  In this case the dhcp
> server should and does reject the request and prepares to send a DHCPNAK
> to the client.
> 
> However, in this case the daddr variable in bootp_reply() is set to
> 0.0.0.0.  Shortly afterwards, it unconditionally attempts to pre-insert the
> new client address into the ARP table.  This causes an assertion failure in
> arp_address_add() because of the 0.0.0.0 address.
> 
> According to RFC2131, DHCPNAK messages for clients on the same subnet
> must be sent to the broadcast address (S3.2, subpoint 2).
> 
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Thanks, applied to the slirp queue.

Jan

> ---
>  slirp/bootp.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/slirp/bootp.c b/slirp/bootp.c
> index efd1fe7..64eac7d 100644
> --- a/slirp/bootp.c
> +++ b/slirp/bootp.c
> @@ -200,7 +200,8 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp)
>              daddr.sin_addr = preq_addr;
>              memcpy(bc->macaddr, client_ethaddr, ETH_ALEN);
>          } else {
> -            daddr.sin_addr.s_addr = 0;
> +            /* DHCPNAKs should be sent to broadcast */
> +            daddr.sin_addr.s_addr = 0xffffffff;
>          }
>      } else {
>          bc = find_addr(slirp, &daddr.sin_addr, bp->bp_hwaddr);

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2012-02-27 13:58 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24  0:23 [Qemu-devel] [0/6] Assorted bugfixes David Gibson
2012-02-24  0:23 ` [Qemu-devel] [PATCH 1/6] kvm: Comparison with ioctl number macros needs to be unsigned David Gibson
2012-02-24  0:23 ` [Qemu-devel] [PATCH 2/6] slirp: Fix assertion failure on rejected DHCP requests David Gibson
2012-02-27 13:58   ` Jan Kiszka [this message]
2012-02-28  1:07     ` David Gibson
2012-02-24  0:23 ` [Qemu-devel] [PATCH 3/6] USB OHCI bug fixes David Gibson
2012-02-27 14:13   ` Gerd Hoffmann
2012-02-28  3:09     ` David Gibson
2012-02-28  3:37       ` David Gibson
2012-02-24  0:23 ` [Qemu-devel] [PATCH 4/6] Endian fixes for virtfs David Gibson
2012-02-24  8:29   ` Aneesh Kumar K.V
2012-02-24  0:23 ` [Qemu-devel] [PATCH 5/6] Endian fix an assertion in usb-msd David Gibson
2012-02-24  0:23 ` [Qemu-devel] [PATCH 6/6] kvm: Fix dirty tracking with large kernel page size David Gibson
2012-02-24  1:03   ` Benjamin Herrenschmidt
2012-02-26 21:41   ` Blue Swirl
2012-02-27  0:16     ` David Gibson
2012-02-27  0:25       ` Benjamin Herrenschmidt
2012-02-27  0:36     ` Alexander Graf
2012-03-03 15:29       ` Blue Swirl
2012-02-28 12:32   ` Avi Kivity
2012-02-28 21:48     ` Benjamin Herrenschmidt
2012-03-04 10:49       ` Avi Kivity
2012-03-04 11:53         ` Benjamin Herrenschmidt
2012-03-04 12:18           ` Avi Kivity
2012-03-04 16:46           ` Andreas Färber
2012-03-04 18:46             ` Alexander Graf
2012-03-04 20:21               ` Andreas Färber
2012-03-04 20:25                 ` Alexander Graf
2012-03-04 20:31                   ` Andreas Färber
2012-03-04 20:59                     ` Alexander Graf
2012-03-04 21:19                       ` Benjamin Herrenschmidt
2012-03-04 21:45                         ` Alexander Graf
2012-03-04 21:21                       ` Andreas Färber
2012-03-04 21:17             ` Benjamin Herrenschmidt
2012-02-28 23:32   ` Alexander Graf
2012-02-29  0:22     ` David Gibson

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=4F4B8BEF.7010500@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=anthony@codemonkey.ws \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    /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.