From: Fabien Chouteau <chouteau@adacore.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Make SLIRP Ethernet packets size to 64 bytes minimum
Date: Mon, 27 Jun 2011 14:41:51 +0200 [thread overview]
Message-ID: <1309178511-20027-1-git-send-email-chouteau@adacore.com> (raw)
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
---
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
next reply other threads:[~2011-06-27 12:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-27 12:41 Fabien Chouteau [this message]
2011-06-27 13:50 ` [Qemu-devel] [PATCH] Make SLIRP Ethernet packets size to 64 bytes minimum Stefan Hajnoczi
2011-06-27 14:23 ` Fabien Chouteau
2011-06-27 15:39 ` Stefan Hajnoczi
2011-06-27 16:12 ` Fabien Chouteau
2011-06-28 8:34 ` Stefan Hajnoczi
2011-06-28 9:08 ` [Qemu-devel] [PATCH] Make SLIRP Ethernet packets size to 64 bytes minimuma Fabien Chouteau
2011-06-28 13:15 ` Stefan Hajnoczi
2011-06-30 8:38 ` Fabien Chouteau
2011-07-05 14:24 ` Fabien Chouteau
2011-08-04 23:04 ` [Qemu-devel] [PATCH] Make SLIRP Ethernet packets size to 64 bytes minimum Edgar E. Iglesias
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=1309178511-20027-1-git-send-email-chouteau@adacore.com \
--to=chouteau@adacore.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).