summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>1999-12-10 03:03:57 +0000
committerJason Wright <jason@cvs.openbsd.org>1999-12-10 03:03:57 +0000
commit738b5374c1c534a11fc5aa0ece7abc95740bbbfb (patch)
treec35157c6b2407000112620acfdf8167951982954 /sys
parent54d061d45b92488ecc6918f918e9b00bf2838a68 (diff)
fix rx mbuf allocation
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/dev/hme.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/sparc/dev/hme.c b/sys/arch/sparc/dev/hme.c
index 751a817cb92..616bfdfcc39 100644
--- a/sys/arch/sparc/dev/hme.c
+++ b/sys/arch/sparc/dev/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.20 1999/08/20 04:55:03 jason Exp $ */
+/* $OpenBSD: hme.c,v 1.21 1999/12/10 03:03:56 jason Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
@@ -822,8 +822,14 @@ hme_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;