aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap
diff options
context:
space:
mode:
authorBrandon Craig Rhodes <brandon@rhodesmill.org>2007-05-28 12:38:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-05-29 11:16:35 -0400
commitd7ea3be56adc95b17351221fd95e78115f3b01f4 (patch)
tree0eb2ab810b298303e207521f5243b85bb16ebf8f /drivers/net/wireless/hostap
parentef7ab2357ba09e8a795018640a87e93dfa043360 (diff)
[PATCH] hostap: Allocate enough tailroom for TKIP
When hostap_tx_encrypt() tries to allocate enough headroom and tailroom for ieee80211 encryption, it only makes enough room for the "mpdu" phase of the operation, but forgets about the "msdu" phase. (For TKIP, these two phases require, respectively, 4 and 8 bytes of tailroom, per the "ieee80211_crypt_tkip" structure at the bottom of net/ieee80211/ieee80211_crypt_tkip.c.) Signed-off-by: Brandon Craig Rhodes <brandon@rhodesmill.org> Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/hostap')
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index 246fac0e8001..3df3c60263d4 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -311,7 +311,7 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
311 local_info_t *local; 311 local_info_t *local;
312 struct ieee80211_hdr_4addr *hdr; 312 struct ieee80211_hdr_4addr *hdr;
313 u16 fc; 313 u16 fc;
314 int hdr_len, res; 314 int prefix_len, postfix_len, hdr_len, res;
315 315
316 iface = netdev_priv(skb->dev); 316 iface = netdev_priv(skb->dev);
317 local = iface->local; 317 local = iface->local;
@@ -337,10 +337,13 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
337 if (skb == NULL) 337 if (skb == NULL)
338 return NULL; 338 return NULL;
339 339
340 if ((skb_headroom(skb) < crypt->ops->extra_mpdu_prefix_len || 340 prefix_len = crypt->ops->extra_mpdu_prefix_len +
341 skb_tailroom(skb) < crypt->ops->extra_mpdu_postfix_len) && 341 crypt->ops->extra_msdu_prefix_len;
342 pskb_expand_head(skb, crypt->ops->extra_mpdu_prefix_len, 342 postfix_len = crypt->ops->extra_mpdu_postfix_len +
343 crypt->ops->extra_mpdu_postfix_len, GFP_ATOMIC)) { 343 crypt->ops->extra_msdu_postfix_len;
344 if ((skb_headroom(skb) < prefix_len ||
345 skb_tailroom(skb) < postfix_len) &&
346 pskb_expand_head(skb, prefix_len, postfix_len, GFP_ATOMIC)) {
344 kfree_skb(skb); 347 kfree_skb(skb);
345 return NULL; 348 return NULL;
346 } 349 }