Merge from the QEMU tree:

- Fix IP packet re-assembly logic (Ed Swierk)
- Suppress unaligned accesses (Fabrice Bellard)
This commit is contained in:
gbeauche 2006-05-14 17:27:38 +00:00
parent e339993b22
commit e4f5757403
3 changed files with 8 additions and 7 deletions

View File

@ -52,8 +52,8 @@ if_init()
if_maxlinkhdr = 40;
#endif
#else
/* 14 for ethernet + 40 */
if_maxlinkhdr = 14 + 40;
/* 2 for alignment, 14 for ethernet, 40 for TCP/IP */
if_maxlinkhdr = 2 + 14 + 40;
#endif
if_mtu = 1500;
if_mru = 1500;

View File

@ -344,8 +344,8 @@ insert:
while (q != (struct ipasfrag *)fp) {
struct mbuf *t;
t = dtom(q);
m_cat(m, t);
q = (struct ipasfrag *) q->ipf_next;
m_cat(m, t);
}
/*

View File

@ -610,11 +610,12 @@ void slirp_input(const uint8_t *pkt, int pkt_len)
m = m_get();
if (!m)
return;
m->m_len = pkt_len;
memcpy(m->m_data, pkt, pkt_len);
/* Note: we add to align the IP header */
m->m_len = pkt_len + 2;
memcpy(m->m_data + 2, pkt, pkt_len);
m->m_data += ETH_HLEN;
m->m_len -= ETH_HLEN;
m->m_data += 2 + ETH_HLEN;
m->m_len -= 2 + ETH_HLEN;
ip_input(m);
break;