[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] slirp: ensure minimum packet size
From: |
Bruce Rogers |
Subject: |
[Qemu-devel] [PATCH] slirp: ensure minimum packet size |
Date: |
Thu, 10 Feb 2011 15:54:28 -0700 |
With recent gpxe eepro100 drivers, short packets are rejected,
so ensure the minimum ethernet packet size.
Signed-off-by: Bruce Rogers <address@hidden>
---
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));
}
}
--
1.6.0.2
- [Qemu-devel] [PATCH] slirp: ensure minimum packet size,
Bruce Rogers <=