Message ID | 20190126212010.11730-2-samuel.thibault@ens-lyon.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [PULL,1/3] slirp: Avoid unaligned 16bit memory access | expand |
diff --git a/slirp/slirp.c b/slirp/slirp.c index a9674ab090..739f364770 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -829,7 +829,7 @@ void slirp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) if (pkt_len < ETH_HLEN) return; - proto = ntohs(*(uint16_t *)(pkt + 12)); + proto = (((uint16_t) pkt[12]) << 8) + pkt[13]; switch(proto) { case ETH_P_ARP: arp_input(slirp, pkt, pkt_len);