summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1999-12-08 22:50:14 +0000
committerJason Wright <jason@cvs.openbsd.org>1999-12-08 22:50:14 +0000
commit4ce85acf748a2a1d3a18ca474069de21604c1f35 (patch)
treec11ef451c5c844af389b194869c8dd06a7d1bb18 /sys/arch
parent231bdb704d715500b7a76e1e9196090594d91eb1 (diff)
fix mbuf chain allocation to comply with m_devget() way
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/dev/be.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/sparc/dev/be.c b/sys/arch/sparc/dev/be.c
index 191ea5b069c..f28479b6385 100644
--- a/sys/arch/sparc/dev/be.c
+++ b/sys/arch/sparc/dev/be.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: be.c,v 1.21 1999/02/15 16:22:26 jason Exp $ */
+/* $OpenBSD: be.c,v 1.22 1999/12/08 22:50:13 jason Exp $ */
/*
* Copyright (c) 1998 Theo de Raadt and Jason L. Wright.
@@ -1068,8 +1068,14 @@ be_get(sc, idx, totlen)
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = totlen;
pad = ALIGN(sizeof(struct ether_header)) - sizeof(struct ether_header);
+ len = MHLEN;
+ if (totlen >= MINCLSIZE) {
+ MCLGET(m, M_DONTWAIT);
+ if (m->m_flags & M_EXT)
+ len = MCLBYTES;
+ }
m->m_data += pad;
- len = MHLEN - pad;
+ len -= pad;
top = NULL;
mp = &top;