From 20c9d198731f440eaad6fafd00fe7ccfcd443a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Mon, 28 May 2007 03:43:39 +0200 Subject: [PATCH] prism54: fix monitor mode oops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manually set the device of a skb for prism54 cards that are in monitor mode as we never call eth_type_trans in that case. Signed-off-by: Björn Steinbrink Signed-off-by: John W. Linville --- drivers/net/wireless/prism54/islpci_eth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index dd070cc..f49eb068 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c @@ -378,9 +378,10 @@ islpci_eth_receive(islpci_private *priv) display_buffer((char *) skb->data, skb->len); #endif /* take care of monitor mode and spy monitoring. */ - if (unlikely(priv->iw_mode == IW_MODE_MONITOR)) + if (unlikely(priv->iw_mode == IW_MODE_MONITOR)) { + skb->dev = ndev; discard = islpci_monitor_rx(priv, &skb); - else { + } else { if (unlikely(skb->data[2 * ETH_ALEN] == 0)) { /* The packet has a rx_annex. Read it for spy monitoring, Then * remove it, while keeping the 2 leading MAC addr. -- cgit v1.1 From d7ea3be56adc95b17351221fd95e78115f3b01f4 Mon Sep 17 00:00:00 2001 From: Brandon Craig Rhodes Date: Mon, 28 May 2007 09:38:46 -0700 Subject: [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 Signed-off-by: Jouni Malinen Signed-off-by: John W. Linville --- drivers/net/wireless/hostap/hostap_80211_tx.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index 246fac0..3df3c60 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, local_info_t *local; struct ieee80211_hdr_4addr *hdr; u16 fc; - int hdr_len, res; + int prefix_len, postfix_len, hdr_len, res; iface = netdev_priv(skb->dev); local = iface->local; @@ -337,10 +337,13 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb, if (skb == NULL) return NULL; - if ((skb_headroom(skb) < crypt->ops->extra_mpdu_prefix_len || - skb_tailroom(skb) < crypt->ops->extra_mpdu_postfix_len) && - pskb_expand_head(skb, crypt->ops->extra_mpdu_prefix_len, - crypt->ops->extra_mpdu_postfix_len, GFP_ATOMIC)) { + prefix_len = crypt->ops->extra_mpdu_prefix_len + + crypt->ops->extra_msdu_prefix_len; + postfix_len = crypt->ops->extra_mpdu_postfix_len + + crypt->ops->extra_msdu_postfix_len; + if ((skb_headroom(skb) < prefix_len || + skb_tailroom(skb) < postfix_len) && + pskb_expand_head(skb, prefix_len, postfix_len, GFP_ATOMIC)) { kfree_skb(skb); return NULL; } -- cgit v1.1