aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wpa.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-08-28 17:01:53 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:48:47 -0400
commiteb063c1702a84d58eb4c05a032bbff6f1c29049d (patch)
tree0aa15bc098e6e4ef0c84bc4944250bba971ac3ad /net/mac80211/wpa.c
parent808718c1477b8350e9e329bf4a35391ac7c7f982 (diff)
[MAC80211]: refactor event sending
Create a new file event.c that will contain code to send mac/mlme events to userspace. For now put the Michael MIC failure condition into it and remove sending of that condition via the management interface, hostapd interestingly doesn't do anything when it gets such a packet besides printing a message, it reacts only on the private iwevent. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/wpa.c')
-rw-r--r--net/mac80211/wpa.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index f5723ea15aae..742b5585d1b7 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -11,10 +11,8 @@
11#include <linux/slab.h> 11#include <linux/slab.h>
12#include <linux/skbuff.h> 12#include <linux/skbuff.h>
13#include <linux/compiler.h> 13#include <linux/compiler.h>
14#include <net/iw_handler.h>
15
16#include <net/mac80211.h> 14#include <net/mac80211.h>
17#include "ieee80211_common.h" 15
18#include "ieee80211_i.h" 16#include "ieee80211_i.h"
19#include "michael.h" 17#include "michael.h"
20#include "tkip.h" 18#include "tkip.h"
@@ -181,33 +179,9 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx)
181 printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " 179 printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from "
182 MAC_FMT "\n", rx->dev->name, MAC_ARG(sa)); 180 MAC_FMT "\n", rx->dev->name, MAC_ARG(sa));
183 181
184 do { 182 mac80211_ev_michael_mic_failure(rx->dev, rx->key->keyidx,
185 struct ieee80211_hdr *hdr; 183 (void *) skb->data);
186 union iwreq_data wrqu; 184 return TXRX_DROP;
187 char *buf = kmalloc(128, GFP_ATOMIC);
188 if (!buf)
189 break;
190
191 /* TODO: needed parameters: count, key type, TSC */
192 hdr = (struct ieee80211_hdr *) skb->data;
193 sprintf(buf, "MLME-MICHAELMICFAILURE.indication("
194 "keyid=%d %scast addr=" MAC_FMT ")",
195 rx->key->keyidx,
196 hdr->addr1[0] & 0x01 ? "broad" : "uni",
197 MAC_ARG(hdr->addr2));
198 memset(&wrqu, 0, sizeof(wrqu));
199 wrqu.data.length = strlen(buf);
200 wireless_send_event(rx->dev, IWEVCUSTOM, &wrqu, buf);
201 kfree(buf);
202 } while (0);
203
204 if (!rx->local->apdev)
205 return TXRX_DROP;
206
207 ieee80211_rx_mgmt(rx->local, rx->skb, rx->u.rx.status,
208 ieee80211_msg_michael_mic_failure);
209
210 return TXRX_QUEUED;
211 } 185 }
212 186
213 remove_mic: 187 remove_mic: