Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194238
b: refs/heads/master
c: 39184b1
h: refs/heads/master
v: v3
  • Loading branch information
Zhu Yi authored and John W. Linville committed Apr 9, 2010
1 parent b35b28c commit d12eea1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1805a34fa33b6284ab8139dd43779b94de58669a
refs/heads/master: 39184b151cbe5ce9f1487190ac4244f69bf6a04b
16 changes: 9 additions & 7 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
{
struct sk_buff *skb = rx->skb;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
struct ieee80211_hdr *hdr;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
int keyidx;
int hdrlen;
ieee80211_rx_result result = RX_DROP_UNUSABLE;
Expand Down Expand Up @@ -861,11 +861,6 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
if (!(rx->flags & IEEE80211_RX_RA_MATCH))
return RX_CONTINUE;

if (skb_linearize(rx->skb))
return RX_DROP_UNUSABLE;

hdr = (struct ieee80211_hdr *)skb->data;

/* start without a key */
rx->key = NULL;

Expand Down Expand Up @@ -906,6 +901,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
rx->key = key;
return RX_CONTINUE;
} else {
u8 keyid;
/*
* The device doesn't give us the IV so we won't be
* able to look up the key. That's ok though, we
Expand All @@ -928,7 +924,8 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
* no need to call ieee80211_wep_get_keyidx,
* it verifies a bunch of things we've done already
*/
keyidx = rx->skb->data[hdrlen + 3] >> 6;
skb_copy_bits(rx->skb, hdrlen + 3, &keyid, 1);
keyidx = keyid >> 6;

rx->key = rcu_dereference(rx->sdata->keys[keyidx]);

Expand All @@ -949,6 +946,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
return RX_DROP_MONITOR;
}

if (skb_linearize(rx->skb))
return RX_DROP_UNUSABLE;

hdr = (struct ieee80211_hdr *)rx->skb->data;

/* Check for weak IVs if possible */
if (rx->sta && rx->key->conf.alg == ALG_WEP &&
ieee80211_is_data(hdr->frame_control) &&
Expand Down

0 comments on commit d12eea1

Please sign in to comment.