From 738b5374c1c534a11fc5aa0ece7abc95740bbbfb Mon Sep 17 00:00:00 2001 From: Jason Wright Date: Fri, 10 Dec 1999 03:03:57 +0000 Subject: fix rx mbuf allocation --- sys/arch/sparc/dev/hme.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sys') 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 = ⊤ -- cgit v1.2.3