In ieee80211_getmbuf, remove the #ifdef __FreeBSD__ code. Check

for MCLGET success using the (m->m_flags & M_EXT) idiom.
This commit is contained in:
dyoung 2005-01-04 00:36:18 +00:00
parent eeb33155cd
commit 4c03aed52f
1 changed files with 8 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ieee80211_output.c,v 1.24 2004/12/27 10:47:57 dyoung Exp $ */
/* $NetBSD: ieee80211_output.c,v 1.25 2005/01/04 00:36:18 dyoung Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
* Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@ -35,7 +35,7 @@
#ifdef __FreeBSD__
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.10 2004/04/02 23:25:39 sam Exp $");
#else
__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.24 2004/12/27 10:47:57 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.25 2005/01/04 00:36:18 dyoung Exp $");
#endif
#include "opt_inet.h"
@ -492,16 +492,14 @@ ieee80211_getmbuf(int flags, int type, u_int pktlen)
struct mbuf *m;
IASSERT(pktlen <= MCLBYTES, ("802.11 packet too large: %u", pktlen));
#ifdef __FreeBSD__
if (pktlen <= MHLEN)
MGETHDR(m, flags, type);
else
m = m_getcl(flags, type, M_PKTHDR);
#else
MGETHDR(m, flags, type);
if (m != NULL && pktlen > MHLEN)
if (m != NULL && pktlen > MHLEN) {
MCLGET(m, flags);
#endif
if ((m->m_flags & M_EXT) == 0) {
m_free(m);
m = NULL;
}
}
return m;
}