From: Anthony Liguori <anthony@codemonkey.ws>
To: Bruce Rogers <brogers@novell.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] slirp: ensure minimum packet size
Date: Fri, 11 Feb 2011 09:26:50 +0100 [thread overview]
Message-ID: <4D54F2CA.5070106@codemonkey.ws> (raw)
In-Reply-To: <4D540A3402000048000A9C8C@novprvoes0310.provo.novell.com>
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<brogers@novell.com>
>
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));
> }
> }
>
>
next prev parent reply other threads:[~2011-02-11 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-10 22:54 [Qemu-devel] [PATCH] slirp: ensure minimum packet size Bruce Rogers
2011-02-11 8:26 ` Anthony Liguori [this message]
2011-02-11 17:46 ` Bruce Rogers
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=4D54F2CA.5070106@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=brogers@novell.com \
--cc=mst@redhat.com \
--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.