summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1996-09-28 10:16:21 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1996-09-28 10:16:21 +0000
commit34762a7080a4c6ae8eb19eafb03e5263964192d5 (patch)
tree9f686ff6036a12a0694dc640ba423e2ea40ae6fa /sys
parent8047d03c1ce86e6368f4130298088101062df5d8 (diff)
Apply Niklas align fix. (better than my try)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/elink3.c8
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 = &top;
@@ -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;