From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48541 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnoLB-0001Ud-MG for qemu-devel@nongnu.org; Fri, 11 Feb 2011 03:26:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnoLA-0008VS-HK for qemu-devel@nongnu.org; Fri, 11 Feb 2011 03:26:57 -0500 Received: from mail-fx0-f45.google.com ([209.85.161.45]:36494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnoLA-0008VM-4t for qemu-devel@nongnu.org; Fri, 11 Feb 2011 03:26:56 -0500 Received: by fxm12 with SMTP id 12so2498052fxm.4 for ; Fri, 11 Feb 2011 00:26:55 -0800 (PST) Message-ID: <4D54F2CA.5070106@codemonkey.ws> Date: Fri, 11 Feb 2011 09:26:50 +0100 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] slirp: ensure minimum packet size References: <4D540A3402000048000A9C8C@novprvoes0310.provo.novell.com> In-Reply-To: <4D540A3402000048000A9C8C@novprvoes0310.provo.novell.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bruce Rogers Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" On 02/10/2011 11:54 PM, Bruce Rogers wrote: > With recent gpxe eepro100 drivers, short packets are rejected, > so ensure the minimum ethernet packet size. > > Signed-off-by: Bruce Rogers > This doesn't make much sense. I think this is more likely a case where we're incorrectly calculating packet size. Michael fixed an issue similar to this in e1000 relating to FCR if I recall correctly. Maybe eepro100 has the same problem? Regards, Anthony Liguori > --- > slirp/slirp.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/slirp/slirp.c b/slirp/slirp.c > index 332d83b..b611cf7 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)); > } > } > >