diff options
author | 1996-09-28 10:16:20 +0000 | |
---|---|---|
committer | 1996-09-28 10:16:20 +0000 | |
commit | 0d7f926210a1fb95acfb7545ebd3211ccceb242c (patch) | |
tree | a0822ea44da0815aad036b2ad1343580eaae95f9 | |
parent | call global system minphys as well (diff) | |
download | wireguard-openbsd-0d7f926210a1fb95acfb7545ebd3211ccceb242c.tar.xz wireguard-openbsd-0d7f926210a1fb95acfb7545ebd3211ccceb242c.zip |
Apply Niklas align fix. (better than my try)
-rw-r--r-- | sys/dev/ic/elink3.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index 2eeaa980333..4b0ab2d71ab 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -702,7 +702,7 @@ epget(sc, totlen) bus_io_handle_t ioh = sc->sc_ioh; struct ifnet *ifp = &sc->sc_arpcom.ac_if; struct mbuf *top, **mp, *m; - int len; + int len, pad; int sh; m = sc->mb[sc->next_mb]; @@ -722,7 +722,9 @@ epget(sc, totlen) } m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = totlen; - len = MHLEN; + pad = ALIGN(sizeof(struct ether_header)) - sizeof(struct ether_header); + m->m_data += pad; + len = MHLEN - pad; top = 0; mp = ⊤ @@ -749,7 +751,7 @@ epget(sc, totlen) } len = MLEN; } - if (totlen >= MINCLSIZE) { + if (top && totlen >= MINCLSIZE) { MCLGET(m, M_DONTWAIT); if (m->m_flags & M_EXT) len = MCLBYTES; |