diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-05-10 19:21:58 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-05-10 19:21:58 +0000 |
commit | 38f3e7c2f526fb70d7bc52ed62910fea506dc84f (patch) | |
tree | 397f8cf91fab6c6f97f6f944ebc74575c059c091 /slirp/slirp.c | |
parent | alignment fix (diff) | |
download | qemu-kvm-38f3e7c2f526fb70d7bc52ed62910fea506dc84f.tar.gz qemu-kvm-38f3e7c2f526fb70d7bc52ed62910fea506dc84f.tar.bz2 qemu-kvm-38f3e7c2f526fb70d7bc52ed62910fea506dc84f.zip |
suppressed unaligned accesses
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1911 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'slirp/slirp.c')
-rw-r--r-- | slirp/slirp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/slirp/slirp.c b/slirp/slirp.c index e88745e8a..6ba753e73 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -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; |