diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/rx.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 2fe8f5f86499..052789ef4745 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -955,12 +955,31 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx) | |||
955 | * have been expected. | 955 | * have been expected. |
956 | */ | 956 | */ |
957 | struct ieee80211_key *key = NULL; | 957 | struct ieee80211_key *key = NULL; |
958 | struct ieee80211_sub_if_data *sdata = rx->sdata; | ||
959 | int i; | ||
960 | |||
958 | if (ieee80211_is_mgmt(fc) && | 961 | if (ieee80211_is_mgmt(fc) && |
959 | is_multicast_ether_addr(hdr->addr1) && | 962 | is_multicast_ether_addr(hdr->addr1) && |
960 | (key = rcu_dereference(rx->sdata->default_mgmt_key))) | 963 | (key = rcu_dereference(rx->sdata->default_mgmt_key))) |
961 | rx->key = key; | 964 | rx->key = key; |
962 | else if ((key = rcu_dereference(rx->sdata->default_key))) | 965 | else { |
963 | rx->key = key; | 966 | if (rx->sta) { |
967 | for (i = 0; i < NUM_DEFAULT_KEYS; i++) { | ||
968 | key = rcu_dereference(rx->sta->gtk[i]); | ||
969 | if (key) | ||
970 | break; | ||
971 | } | ||
972 | } | ||
973 | if (!key) { | ||
974 | for (i = 0; i < NUM_DEFAULT_KEYS; i++) { | ||
975 | key = rcu_dereference(sdata->keys[i]); | ||
976 | if (key) | ||
977 | break; | ||
978 | } | ||
979 | } | ||
980 | if (key) | ||
981 | rx->key = key; | ||
982 | } | ||
964 | return RX_CONTINUE; | 983 | return RX_CONTINUE; |
965 | } else { | 984 | } else { |
966 | u8 keyid; | 985 | u8 keyid; |