From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35293 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovyfk-0002US-0M for qemu-devel@nongnu.org; Wed, 15 Sep 2010 16:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ovyfi-0006VH-NB for qemu-devel@nongnu.org; Wed, 15 Sep 2010 16:33:39 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:38909) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ovyfi-0006Ut-3j for qemu-devel@nongnu.org; Wed, 15 Sep 2010 16:33:38 -0400 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 15 Sep 2010 22:33:26 +0200 Message-Id: <1284582806-4129-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2] [slirp] Make ARP replies at least 64 bytes long List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= 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=C3=A9 Poussineau --- 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 *pk= t, int pkt_len) { struct ethhdr *eh =3D (struct ethhdr *)pkt; struct arphdr *ah =3D (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 =3D (struct ethhdr *)arp_reply; struct arphdr *rah =3D (struct arphdr *)(arp_reply + ETH_HLEN); int ar_op; @@ -619,6 +619,7 @@ static void arp_input(Slirp *slirp, const uint8_t *pk= t, 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); =20 --=20 1.7.1.GIT