diff options
author | Jouni Malinen <j@w1.fi> | 2009-03-27 15:59:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:28 -0400 |
commit | a3b8b0569fbef725597f05278ec58083321f6e9d (patch) | |
tree | cb3beb05c841a9564a3fdd44d540570c7b89c9f6 /net/mac80211/event.c | |
parent | 53b46b8444f600cc1744521ea096ea0c5d494dd0 (diff) |
nl80211: Add Michael MIC failure event
Define a new nl80211 event, NL80211_CMD_MICHAEL_MIC_FAILURE, to be
used to notify user space about locally detected Michael MIC failures.
This matches with the MLME-MICHAELMICFAILURE.indication() primitive.
Since we do not actually have TSC in the skb anymore when
mac80211_ev_michael_mic_failure() is called, that function is changed
to take in the TSC as an optional parameter instead of as a
requirement to include the TSC after the hdr field (which we did not
really follow). For now, TSC is not included in the events from
mac80211, but it could be added at some point.
Signed-off-by: Jouni Malinen <j@w1.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/event.c')
-rw-r--r-- | net/mac80211/event.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/mac80211/event.c b/net/mac80211/event.c index 0d95561c0ee0..f288d01a6344 100644 --- a/net/mac80211/event.c +++ b/net/mac80211/event.c | |||
@@ -12,12 +12,12 @@ | |||
12 | #include "ieee80211_i.h" | 12 | #include "ieee80211_i.h" |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * indicate a failed Michael MIC to userspace; the passed packet | 15 | * Indicate a failed Michael MIC to userspace. If the caller knows the TSC of |
16 | * (in the variable hdr) must be long enough to extract the TKIP | 16 | * the frame that generated the MIC failure (i.e., if it was provided by the |
17 | * fields like TSC | 17 | * driver or is still in the frame), it should provide that information. |
18 | */ | 18 | */ |
19 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, | 19 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, |
20 | struct ieee80211_hdr *hdr) | 20 | struct ieee80211_hdr *hdr, const u8 *tsc) |
21 | { | 21 | { |
22 | union iwreq_data wrqu; | 22 | union iwreq_data wrqu; |
23 | char *buf = kmalloc(128, GFP_ATOMIC); | 23 | char *buf = kmalloc(128, GFP_ATOMIC); |
@@ -34,8 +34,9 @@ void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int ke | |||
34 | kfree(buf); | 34 | kfree(buf); |
35 | } | 35 | } |
36 | 36 | ||
37 | /* | 37 | cfg80211_michael_mic_failure(sdata->dev, hdr->addr2, |
38 | * TODO: re-add support for sending MIC failure indication | 38 | (hdr->addr1[0] & 0x01) ? |
39 | * with all info via nl80211 | 39 | NL80211_KEYTYPE_GROUP : |
40 | */ | 40 | NL80211_KEYTYPE_PAIRWISE, |
41 | keyidx, tsc); | ||
41 | } | 42 | } |