diff options
author | 1999-12-08 22:50:13 +0000 | |
---|---|---|
committer | 1999-12-08 22:50:13 +0000 | |
commit | 61d0cc14a0046406355a51971ac69a756d7f7b81 (patch) | |
tree | 54c3d1bd05bfd5c77b67d24c4236f82c49c31fca | |
parent | fix mbuf chain allocation to comply with m_devget() way. (diff) | |
download | wireguard-openbsd-61d0cc14a0046406355a51971ac69a756d7f7b81.tar.xz wireguard-openbsd-61d0cc14a0046406355a51971ac69a756d7f7b81.zip |
fix mbuf chain allocation to comply with m_devget() way
-rw-r--r-- | sys/arch/sparc/dev/be.c | 10 |
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 = ⊤ |