diff options
author | Saravana <saravanad@posedge.com> | 2012-12-04 09:17:42 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-12-05 03:44:41 -0500 |
commit | b98ea05861d76f458029096e8b2939fcb58e9530 (patch) | |
tree | a12b1993b0495a2c5f980f14ea94553ccae2b24e /net/mac80211/wpa.c | |
parent | a6662dbae0b3a7a91317ec88b5aa0cf8d716f183 (diff) |
mac80211: add debug file for mic failure
The mic failure count provides the number of mic failures that
have happened on a given key (without a countermeasure being
started, since that would remove the key).
Signed-off-by: Saravana <saravanad@posedge.com>
[fix NULL pointer issues]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/wpa.c')
-rw-r--r-- | net/mac80211/wpa.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 8bd2f5c6a56e..c175ee866ff4 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -104,7 +104,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) | |||
104 | */ | 104 | */ |
105 | if (status->flag & (RX_FLAG_MMIC_STRIPPED | RX_FLAG_IV_STRIPPED)) { | 105 | if (status->flag & (RX_FLAG_MMIC_STRIPPED | RX_FLAG_IV_STRIPPED)) { |
106 | if (status->flag & RX_FLAG_MMIC_ERROR) | 106 | if (status->flag & RX_FLAG_MMIC_ERROR) |
107 | goto mic_fail; | 107 | goto mic_fail_no_key; |
108 | 108 | ||
109 | if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key && | 109 | if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key && |
110 | rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP) | 110 | rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP) |
@@ -161,6 +161,9 @@ update_iv: | |||
161 | return RX_CONTINUE; | 161 | return RX_CONTINUE; |
162 | 162 | ||
163 | mic_fail: | 163 | mic_fail: |
164 | rx->key->u.tkip.mic_failures++; | ||
165 | |||
166 | mic_fail_no_key: | ||
164 | /* | 167 | /* |
165 | * In some cases the key can be unset - e.g. a multicast packet, in | 168 | * In some cases the key can be unset - e.g. a multicast packet, in |
166 | * a driver that supports HW encryption. Send up the key idx only if | 169 | * a driver that supports HW encryption. Send up the key idx only if |