Received: from eggs.gnu.org ([140.186.70.92]:40596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbB8m-0006b8-UN for qemu-devel@nongnu.org; Mon, 27 Jun 2011 08:42:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbB8k-0004TA-PS for qemu-devel@nongnu.org; Mon, 27 Jun 2011 08:42:12 -0400 Received: from mel.act-europe.fr ([194.98.77.210]:40670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbB8k-0004SS-8d for qemu-devel@nongnu.org; Mon, 27 Jun 2011 08:42:10 -0400 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id BD06ACB023D for ; Mon, 27 Jun 2011 14:41:57 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vH9LRv+NQtuE for ; Mon, 27 Jun 2011 14:41:54 +0200 (CEST) Received: from PomPomGalli.act-europe.fr (pompomgalli.act-europe.fr [10.10.1.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id B88C5CB01F2 for ; Mon, 27 Jun 2011 14:41:54 +0200 (CEST) From: Fabien Chouteau Date: Mon, 27 Jun 2011 14:41:51 +0200 Message-Id: <1309178511-20027-1-git-send-email-chouteau@adacore.com> Subject: [Qemu-devel] [PATCH] Make SLIRP Ethernet packets size to 64 bytes minimum List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Fabien Chouteau --- slirp/slirp.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/slirp/slirp.c b/slirp/slirp.c index 1593be1..be30501 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -697,7 +697,7 @@ void if_encap(Slirp *slirp, const uint8_t *ip_data, int ip_data_len) return; if (!memcmp(slirp->client_ethaddr, zero_ethaddr, ETH_ALEN)) { - uint8_t arp_req[ETH_HLEN + sizeof(struct arphdr)]; + uint8_t arp_req[max(ETH_HLEN + sizeof(struct arphdr), 64)]; struct ethhdr *reh = (struct ethhdr *)arp_req; struct arphdr *rah = (struct arphdr *)(arp_req + ETH_HLEN); const struct ip *iph = (const struct ip *)ip_data; @@ -734,7 +734,7 @@ void if_encap(Slirp *slirp, const uint8_t *ip_data, int ip_data_len) memcpy(&eh->h_source[2], &slirp->vhost_addr, 4); eh->h_proto = htons(ETH_P_IP); memcpy(buf + sizeof(struct ethhdr), ip_data, ip_data_len); - slirp_output(slirp->opaque, buf, ip_data_len + ETH_HLEN); + slirp_output(slirp->opaque, buf, max(ip_data_len + ETH_HLEN, 64)); } } -- 1.7.4.1