From 09fd81a23f414df485fc1d05dc4f1c434315c4db Mon Sep 17 00:00:00 2001 From: henning Date: Tue, 12 Aug 2008 16:14:45 +0000 Subject: [PATCH] use MINCLSIZE to decide wether we need to allocate an mbuf cluster instead of MLEM, damien ok --- sys/net80211/ieee80211_crypto_ccmp.c | 6 +++--- sys/net80211/ieee80211_crypto_tkip.c | 6 +++--- sys/net80211/ieee80211_crypto_wep.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index f6eef7dca16..6cbc3b6df73 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.2 2008/07/26 12:41:34 damien Exp $ */ +/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.3 2008/08/12 16:14:45 henning Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini @@ -246,7 +246,7 @@ ieee80211_ccmp_encrypt(struct ieee80211com *ic, struct mbuf *m0, goto nospace; n = n->m_next; n->m_len = MLEN; - if (left > MLEN - IEEE80211_CCMP_MICLEN) { + if (left >= MINCLSIZE - IEEE80211_CCMP_MICLEN) { MCLGET(n, M_DONTWAIT); if (n->m_flags & M_EXT) n->m_len = n->m_ext.ext_size; @@ -400,7 +400,7 @@ ieee80211_ccmp_decrypt(struct ieee80211com *ic, struct mbuf *m0, goto nospace; n = n->m_next; n->m_len = MLEN; - if (left > MLEN) { + if (left >= MINCLSIZE) { MCLGET(n, M_DONTWAIT); if (n->m_flags & M_EXT) n->m_len = n->m_ext.ext_size; diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c index 188442e4d71..53156bdbd68 100644 --- a/sys/net80211/ieee80211_crypto_tkip.c +++ b/sys/net80211/ieee80211_crypto_tkip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_tkip.c,v 1.4 2008/07/26 12:36:15 damien Exp $ */ +/* $OpenBSD: ieee80211_crypto_tkip.c,v 1.5 2008/08/12 16:14:45 henning Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini @@ -254,7 +254,7 @@ ieee80211_tkip_encrypt(struct ieee80211com *ic, struct mbuf *m0, goto nospace; n = n->m_next; n->m_len = MLEN; - if (left > MLEN - IEEE80211_TKIP_TAILLEN) { + if (left >= MINCLSIZE - IEEE80211_TKIP_TAILLEN) { MCLGET(n, M_DONTWAIT); if (n->m_flags & M_EXT) n->m_len = n->m_ext.ext_size; @@ -404,7 +404,7 @@ ieee80211_tkip_decrypt(struct ieee80211com *ic, struct mbuf *m0, goto nospace; n = n->m_next; n->m_len = MLEN; - if (left > MLEN) { + if (left >= MINCLSIZE) { MCLGET(n, M_DONTWAIT); if (n->m_flags & M_EXT) n->m_len = n->m_ext.ext_size; diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c index 0ec3ee8d33b..f94dcfc8673 100644 --- a/sys/net80211/ieee80211_crypto_wep.c +++ b/sys/net80211/ieee80211_crypto_wep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_wep.c,v 1.3 2008/07/26 12:42:57 damien Exp $ */ +/* $OpenBSD: ieee80211_crypto_wep.c,v 1.4 2008/08/12 16:14:45 henning Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini @@ -144,7 +144,7 @@ ieee80211_wep_encrypt(struct ieee80211com *ic, struct mbuf *m0, goto nospace; n = n->m_next; n->m_len = MLEN; - if (left > MLEN - IEEE80211_WEP_CRCLEN) { + if (left >= MINCLSIZE - IEEE80211_WEP_CRCLEN) { MCLGET(n, M_DONTWAIT); if (n->m_flags & M_EXT) n->m_len = n->m_ext.ext_size; @@ -259,7 +259,7 @@ ieee80211_wep_decrypt(struct ieee80211com *ic, struct mbuf *m0, goto nospace; n = n->m_next; n->m_len = MLEN; - if (left > MLEN) { + if (left >= MINCLSIZE) { MCLGET(n, M_DONTWAIT); if (n->m_flags & M_EXT) n->m_len = n->m_ext.ext_size; -- 2.20.1