summaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_crypto_tkip.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2008-08-12 16:14:46 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2008-08-12 16:14:46 +0000
commit77bc72d3e8c5d32f05be63fb15cf2c4440ca62a5 (patch)
tree79460a8997d9663f59c200ed6ecaf0d110e806b1 /sys/net80211/ieee80211_crypto_tkip.c
parentf7fbf9fc99797b3d605dc374b4aec198ec959a2f (diff)
use MINCLSIZE to decide wether we need to allocate an mbuf cluster instead
of MLEM, damien ok
Diffstat (limited to 'sys/net80211/ieee80211_crypto_tkip.c')
-rw-r--r--sys/net80211/ieee80211_crypto_tkip.c6
1 files changed, 3 insertions, 3 deletions
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 <damien.bergamini@free.fr>
@@ -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;