From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59339 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwYr6-00036T-69 for qemu-devel@nongnu.org; Fri, 17 Sep 2010 07:11:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwYr4-0007Qt-QL for qemu-devel@nongnu.org; Fri, 17 Sep 2010 07:11:48 -0400 Received: from mail-bw0-f45.google.com ([209.85.214.45]:60439) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwYr4-0007Qn-KE for qemu-devel@nongnu.org; Fri, 17 Sep 2010 07:11:46 -0400 Received: by bwz4 with SMTP id 4so2829163bwz.4 for ; Fri, 17 Sep 2010 04:11:46 -0700 (PDT) Date: Fri, 17 Sep 2010 12:56:36 +0200 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] [PATCH v2] [slirp] Make ARP replies at least 64 bytes long Message-ID: <20100917105636.GB18090@edde.se.axis.com> References: <1284582806-4129-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1284582806-4129-1-git-send-email-hpoussin@reactos.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Herv=E9?= Poussineau Cc: qemu-devel@nongnu.org On Wed, Sep 15, 2010 at 10:33:26PM +0200, Hervé Poussineau wrote: > IEEE 802.3 standard requires Ethernet frames to be at least 64 bytes long. > If it is not the case, they will be considered as runt frames, and may be ignored by netcard and/or OS > > Signed-off-by: Hervé Poussineau Applied, thanks. > --- > slirp/slirp.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/slirp/slirp.c b/slirp/slirp.c > index 82fd9b4..332d83b 100644 > --- a/slirp/slirp.c > +++ b/slirp/slirp.c > @@ -599,7 +599,7 @@ static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) > { > struct ethhdr *eh = (struct ethhdr *)pkt; > struct arphdr *ah = (struct arphdr *)(pkt + ETH_HLEN); > - uint8_t arp_reply[ETH_HLEN + sizeof(struct arphdr)]; > + uint8_t arp_reply[max(ETH_HLEN + sizeof(struct arphdr), 64)]; > struct ethhdr *reh = (struct ethhdr *)arp_reply; > struct arphdr *rah = (struct arphdr *)(arp_reply + ETH_HLEN); > int ar_op; > @@ -619,6 +619,7 @@ static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) > } > return; > arp_ok: > + memset(arp_reply, 0, sizeof(arp_reply)); > /* XXX: make an ARP request to have the client address */ > memcpy(slirp->client_ethaddr, eh->h_source, ETH_ALEN); > > -- > 1.7.1.GIT > >