diff options
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index b52e3305a8f8..976b646a40de 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -374,7 +374,7 @@ ieee80211_rx_h_load_key(struct ieee80211_txrx_data *rx) | |||
374 | * pairwise or station-to-station keys, but for WEP we allow | 374 | * pairwise or station-to-station keys, but for WEP we allow |
375 | * using a key index as well. | 375 | * using a key index as well. |
376 | */ | 376 | */ |
377 | if (rx->key && rx->key->alg != ALG_WEP && | 377 | if (rx->key && rx->key->conf.alg != ALG_WEP && |
378 | !is_multicast_ether_addr(hdr->addr1)) | 378 | !is_multicast_ether_addr(hdr->addr1)) |
379 | rx->key = NULL; | 379 | rx->key = NULL; |
380 | } | 380 | } |
@@ -522,18 +522,15 @@ ieee80211_rx_h_wep_weak_iv_detection(struct ieee80211_txrx_data *rx) | |||
522 | { | 522 | { |
523 | if (!rx->sta || !(rx->fc & IEEE80211_FCTL_PROTECTED) || | 523 | if (!rx->sta || !(rx->fc & IEEE80211_FCTL_PROTECTED) || |
524 | (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA || | 524 | (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA || |
525 | !rx->key || rx->key->alg != ALG_WEP || | 525 | !rx->key || rx->key->conf.alg != ALG_WEP || |
526 | !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) | 526 | !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) |
527 | return TXRX_CONTINUE; | 527 | return TXRX_CONTINUE; |
528 | 528 | ||
529 | /* Check for weak IVs, if hwaccel did not remove IV from the frame */ | 529 | /* Check for weak IVs, if hwaccel did not remove IV from the frame */ |
530 | if ((rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV) || | 530 | if ((rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV) || |
531 | rx->key->force_sw_encrypt) { | 531 | (rx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT)) |
532 | u8 *iv = ieee80211_wep_is_weak_iv(rx->skb, rx->key); | 532 | if (ieee80211_wep_is_weak_iv(rx->skb, rx->key)) |
533 | if (iv) { | ||
534 | rx->sta->wep_weak_iv_count++; | 533 | rx->sta->wep_weak_iv_count++; |
535 | } | ||
536 | } | ||
537 | 534 | ||
538 | return TXRX_CONTINUE; | 535 | return TXRX_CONTINUE; |
539 | } | 536 | } |
@@ -541,7 +538,7 @@ ieee80211_rx_h_wep_weak_iv_detection(struct ieee80211_txrx_data *rx) | |||
541 | static ieee80211_txrx_result | 538 | static ieee80211_txrx_result |
542 | ieee80211_rx_h_wep_decrypt(struct ieee80211_txrx_data *rx) | 539 | ieee80211_rx_h_wep_decrypt(struct ieee80211_txrx_data *rx) |
543 | { | 540 | { |
544 | if ((rx->key && rx->key->alg != ALG_WEP) || | 541 | if ((rx->key && rx->key->conf.alg != ALG_WEP) || |
545 | !(rx->fc & IEEE80211_FCTL_PROTECTED) || | 542 | !(rx->fc & IEEE80211_FCTL_PROTECTED) || |
546 | ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA && | 543 | ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA && |
547 | ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT || | 544 | ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT || |
@@ -556,7 +553,7 @@ ieee80211_rx_h_wep_decrypt(struct ieee80211_txrx_data *rx) | |||
556 | } | 553 | } |
557 | 554 | ||
558 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED) || | 555 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED) || |
559 | rx->key->force_sw_encrypt) { | 556 | (rx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT)) { |
560 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) { | 557 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) { |
561 | if (net_ratelimit()) | 558 | if (net_ratelimit()) |
562 | printk(KERN_DEBUG "%s: RX WEP frame, decrypt " | 559 | printk(KERN_DEBUG "%s: RX WEP frame, decrypt " |
@@ -680,7 +677,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) | |||
680 | /* This is the first fragment of a new frame. */ | 677 | /* This is the first fragment of a new frame. */ |
681 | entry = ieee80211_reassemble_add(rx->sdata, frag, seq, | 678 | entry = ieee80211_reassemble_add(rx->sdata, frag, seq, |
682 | rx->u.rx.queue, &(rx->skb)); | 679 | rx->u.rx.queue, &(rx->skb)); |
683 | if (rx->key && rx->key->alg == ALG_CCMP && | 680 | if (rx->key && rx->key->conf.alg == ALG_CCMP && |
684 | (rx->fc & IEEE80211_FCTL_PROTECTED)) { | 681 | (rx->fc & IEEE80211_FCTL_PROTECTED)) { |
685 | /* Store CCMP PN so that we can verify that the next | 682 | /* Store CCMP PN so that we can verify that the next |
686 | * fragment has a sequential PN value. */ | 683 | * fragment has a sequential PN value. */ |
@@ -707,7 +704,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) | |||
707 | if (entry->ccmp) { | 704 | if (entry->ccmp) { |
708 | int i; | 705 | int i; |
709 | u8 pn[CCMP_PN_LEN], *rpn; | 706 | u8 pn[CCMP_PN_LEN], *rpn; |
710 | if (!rx->key || rx->key->alg != ALG_CCMP) | 707 | if (!rx->key || rx->key->conf.alg != ALG_CCMP) |
711 | return TXRX_DROP; | 708 | return TXRX_DROP; |
712 | memcpy(pn, entry->last_pn, CCMP_PN_LEN); | 709 | memcpy(pn, entry->last_pn, CCMP_PN_LEN); |
713 | for (i = CCMP_PN_LEN - 1; i >= 0; i--) { | 710 | for (i = CCMP_PN_LEN - 1; i >= 0; i--) { |
@@ -900,7 +897,8 @@ ieee80211_rx_h_drop_unencrypted(struct ieee80211_txrx_data *rx) | |||
900 | * uploaded to the hardware. | 897 | * uploaded to the hardware. |
901 | */ | 898 | */ |
902 | if ((rx->local->hw.flags & IEEE80211_HW_DEVICE_HIDES_WEP) && | 899 | if ((rx->local->hw.flags & IEEE80211_HW_DEVICE_HIDES_WEP) && |
903 | (!rx->key || !rx->key->force_sw_encrypt)) | 900 | (!rx->key || |
901 | !(rx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT))) | ||
904 | return TXRX_CONTINUE; | 902 | return TXRX_CONTINUE; |
905 | 903 | ||
906 | /* Drop unencrypted frames if key is set. */ | 904 | /* Drop unencrypted frames if key is set. */ |