diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-01-31 13:48:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:37:02 -0500 |
commit | e4c26add8893e40e6e809b8c1ebc81e37762af2b (patch) | |
tree | fb11a53da8c2cc6af47ca5436ce41cf7068b3949 | |
parent | 9ae54c8463691b64ca6e6d8680787a6527810984 (diff) |
mac80211: split RX_DROP
Some instances of RX_DROP mean that the frame was useless,
others mean that the frame should be visible in userspace
on "cooked" monitor interfaces. This patch splits up RX_DROP
and changes each instance appropriately.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/ieee80211_i.h | 7 | ||||
-rw-r--r-- | net/mac80211/ieee80211_sta.c | 4 | ||||
-rw-r--r-- | net/mac80211/rx.c | 59 | ||||
-rw-r--r-- | net/mac80211/wep.c | 2 | ||||
-rw-r--r-- | net/mac80211/wpa.c | 16 |
5 files changed, 45 insertions, 43 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 36ea4fbdf950..31fc64c5652c 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -114,9 +114,10 @@ typedef unsigned __bitwise__ ieee80211_tx_result; | |||
114 | #define TX_QUEUED ((__force ieee80211_tx_result) 2u) | 114 | #define TX_QUEUED ((__force ieee80211_tx_result) 2u) |
115 | 115 | ||
116 | typedef unsigned __bitwise__ ieee80211_rx_result; | 116 | typedef unsigned __bitwise__ ieee80211_rx_result; |
117 | #define RX_CONTINUE ((__force ieee80211_rx_result) 0u) | 117 | #define RX_CONTINUE ((__force ieee80211_rx_result) 0u) |
118 | #define RX_DROP ((__force ieee80211_rx_result) 1u) | 118 | #define RX_DROP_UNUSABLE ((__force ieee80211_rx_result) 1u) |
119 | #define RX_QUEUED ((__force ieee80211_rx_result) 2u) | 119 | #define RX_DROP_MONITOR ((__force ieee80211_rx_result) 2u) |
120 | #define RX_QUEUED ((__force ieee80211_rx_result) 3u) | ||
120 | 121 | ||
121 | 122 | ||
122 | /* flags used in struct ieee80211_txrx_data.flags */ | 123 | /* flags used in struct ieee80211_txrx_data.flags */ |
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 991689371bdc..a8251a23917b 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -2567,7 +2567,7 @@ ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb, | |||
2567 | u16 fc; | 2567 | u16 fc; |
2568 | 2568 | ||
2569 | if (skb->len < 2) | 2569 | if (skb->len < 2) |
2570 | return RX_DROP; | 2570 | return RX_DROP_UNUSABLE; |
2571 | 2571 | ||
2572 | mgmt = (struct ieee80211_mgmt *) skb->data; | 2572 | mgmt = (struct ieee80211_mgmt *) skb->data; |
2573 | fc = le16_to_cpu(mgmt->frame_control); | 2573 | fc = le16_to_cpu(mgmt->frame_control); |
@@ -2576,7 +2576,7 @@ ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb, | |||
2576 | return RX_CONTINUE; | 2576 | return RX_CONTINUE; |
2577 | 2577 | ||
2578 | if (skb->len < 24) | 2578 | if (skb->len < 24) |
2579 | return RX_DROP; | 2579 | return RX_DROP_MONITOR; |
2580 | 2580 | ||
2581 | if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) { | 2581 | if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) { |
2582 | if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP) { | 2582 | if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP) { |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index ffd68d9a0013..860c488984d8 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -380,7 +380,7 @@ ieee80211_rx_h_passive_scan(struct ieee80211_txrx_data *rx) | |||
380 | if (unlikely(rx->flags & IEEE80211_TXRXD_RXIN_SCAN)) { | 380 | if (unlikely(rx->flags & IEEE80211_TXRXD_RXIN_SCAN)) { |
381 | /* scanning finished during invoking of handlers */ | 381 | /* scanning finished during invoking of handlers */ |
382 | I802_DEBUG_INC(local->rx_handlers_drop_passive_scan); | 382 | I802_DEBUG_INC(local->rx_handlers_drop_passive_scan); |
383 | return RX_DROP; | 383 | return RX_DROP_UNUSABLE; |
384 | } | 384 | } |
385 | 385 | ||
386 | return RX_CONTINUE; | 386 | return RX_CONTINUE; |
@@ -401,14 +401,14 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx) | |||
401 | rx->local->dot11FrameDuplicateCount++; | 401 | rx->local->dot11FrameDuplicateCount++; |
402 | rx->sta->num_duplicates++; | 402 | rx->sta->num_duplicates++; |
403 | } | 403 | } |
404 | return RX_DROP; | 404 | return RX_DROP_MONITOR; |
405 | } else | 405 | } else |
406 | rx->sta->last_seq_ctrl[rx->u.rx.queue] = hdr->seq_ctrl; | 406 | rx->sta->last_seq_ctrl[rx->u.rx.queue] = hdr->seq_ctrl; |
407 | } | 407 | } |
408 | 408 | ||
409 | if (unlikely(rx->skb->len < 16)) { | 409 | if (unlikely(rx->skb->len < 16)) { |
410 | I802_DEBUG_INC(rx->local->rx_handlers_drop_short); | 410 | I802_DEBUG_INC(rx->local->rx_handlers_drop_short); |
411 | return RX_DROP; | 411 | return RX_DROP_MONITOR; |
412 | } | 412 | } |
413 | 413 | ||
414 | /* Drop disallowed frame classes based on STA auth/assoc state; | 414 | /* Drop disallowed frame classes based on STA auth/assoc state; |
@@ -430,10 +430,10 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx) | |||
430 | || !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) { | 430 | || !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) { |
431 | /* Drop IBSS frames and frames for other hosts | 431 | /* Drop IBSS frames and frames for other hosts |
432 | * silently. */ | 432 | * silently. */ |
433 | return RX_DROP; | 433 | return RX_DROP_MONITOR; |
434 | } | 434 | } |
435 | 435 | ||
436 | return RX_DROP; | 436 | return RX_DROP_MONITOR; |
437 | } | 437 | } |
438 | 438 | ||
439 | return RX_CONTINUE; | 439 | return RX_CONTINUE; |
@@ -446,7 +446,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx) | |||
446 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data; | 446 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data; |
447 | int keyidx; | 447 | int keyidx; |
448 | int hdrlen; | 448 | int hdrlen; |
449 | ieee80211_rx_result result = RX_DROP; | 449 | ieee80211_rx_result result = RX_DROP_UNUSABLE; |
450 | struct ieee80211_key *stakey = NULL; | 450 | struct ieee80211_key *stakey = NULL; |
451 | 451 | ||
452 | /* | 452 | /* |
@@ -507,7 +507,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx) | |||
507 | hdrlen = ieee80211_get_hdrlen(rx->fc); | 507 | hdrlen = ieee80211_get_hdrlen(rx->fc); |
508 | 508 | ||
509 | if (rx->skb->len < 8 + hdrlen) | 509 | if (rx->skb->len < 8 + hdrlen) |
510 | return RX_DROP; /* TODO: count this? */ | 510 | return RX_DROP_UNUSABLE; /* TODO: count this? */ |
511 | 511 | ||
512 | /* | 512 | /* |
513 | * no need to call ieee80211_wep_get_keyidx, | 513 | * no need to call ieee80211_wep_get_keyidx, |
@@ -536,7 +536,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx) | |||
536 | printk(KERN_DEBUG "%s: RX protected frame," | 536 | printk(KERN_DEBUG "%s: RX protected frame," |
537 | " but have no key\n", rx->dev->name); | 537 | " but have no key\n", rx->dev->name); |
538 | #endif /* CONFIG_MAC80211_DEBUG */ | 538 | #endif /* CONFIG_MAC80211_DEBUG */ |
539 | return RX_DROP; | 539 | return RX_DROP_MONITOR; |
540 | } | 540 | } |
541 | 541 | ||
542 | /* Check for weak IVs if possible */ | 542 | /* Check for weak IVs if possible */ |
@@ -821,7 +821,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) | |||
821 | rx->u.rx.queue, hdr); | 821 | rx->u.rx.queue, hdr); |
822 | if (!entry) { | 822 | if (!entry) { |
823 | I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); | 823 | I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); |
824 | return RX_DROP; | 824 | return RX_DROP_MONITOR; |
825 | } | 825 | } |
826 | 826 | ||
827 | /* Verify that MPDUs within one MSDU have sequential PN values. | 827 | /* Verify that MPDUs within one MSDU have sequential PN values. |
@@ -830,7 +830,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) | |||
830 | int i; | 830 | int i; |
831 | u8 pn[CCMP_PN_LEN], *rpn; | 831 | u8 pn[CCMP_PN_LEN], *rpn; |
832 | if (!rx->key || rx->key->conf.alg != ALG_CCMP) | 832 | if (!rx->key || rx->key->conf.alg != ALG_CCMP) |
833 | return RX_DROP; | 833 | return RX_DROP_UNUSABLE; |
834 | memcpy(pn, entry->last_pn, CCMP_PN_LEN); | 834 | memcpy(pn, entry->last_pn, CCMP_PN_LEN); |
835 | for (i = CCMP_PN_LEN - 1; i >= 0; i--) { | 835 | for (i = CCMP_PN_LEN - 1; i >= 0; i--) { |
836 | pn[i]++; | 836 | pn[i]++; |
@@ -848,7 +848,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) | |||
848 | rpn[0], rpn[1], rpn[2], rpn[3], rpn[4], | 848 | rpn[0], rpn[1], rpn[2], rpn[3], rpn[4], |
849 | rpn[5], pn[0], pn[1], pn[2], pn[3], | 849 | rpn[5], pn[0], pn[1], pn[2], pn[3], |
850 | pn[4], pn[5]); | 850 | pn[4], pn[5]); |
851 | return RX_DROP; | 851 | return RX_DROP_UNUSABLE; |
852 | } | 852 | } |
853 | memcpy(entry->last_pn, pn, CCMP_PN_LEN); | 853 | memcpy(entry->last_pn, pn, CCMP_PN_LEN); |
854 | } | 854 | } |
@@ -869,7 +869,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) | |||
869 | GFP_ATOMIC))) { | 869 | GFP_ATOMIC))) { |
870 | I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); | 870 | I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); |
871 | __skb_queue_purge(&entry->skb_list); | 871 | __skb_queue_purge(&entry->skb_list); |
872 | return RX_DROP; | 872 | return RX_DROP_UNUSABLE; |
873 | } | 873 | } |
874 | } | 874 | } |
875 | while ((skb = __skb_dequeue(&entry->skb_list))) { | 875 | while ((skb = __skb_dequeue(&entry->skb_list))) { |
@@ -906,7 +906,7 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx) | |||
906 | 906 | ||
907 | if ((sdata->vif.type != IEEE80211_IF_TYPE_AP) && | 907 | if ((sdata->vif.type != IEEE80211_IF_TYPE_AP) && |
908 | (sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) | 908 | (sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) |
909 | return RX_DROP; | 909 | return RX_DROP_UNUSABLE; |
910 | 910 | ||
911 | skb = skb_dequeue(&rx->sta->tx_filtered); | 911 | skb = skb_dequeue(&rx->sta->tx_filtered); |
912 | if (!skb) { | 912 | if (!skb) { |
@@ -1257,14 +1257,14 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx) | |||
1257 | return RX_CONTINUE; | 1257 | return RX_CONTINUE; |
1258 | 1258 | ||
1259 | if (unlikely(!WLAN_FC_DATA_PRESENT(fc))) | 1259 | if (unlikely(!WLAN_FC_DATA_PRESENT(fc))) |
1260 | return RX_DROP; | 1260 | return RX_DROP_MONITOR; |
1261 | 1261 | ||
1262 | if (!(rx->flags & IEEE80211_TXRXD_RX_AMSDU)) | 1262 | if (!(rx->flags & IEEE80211_TXRXD_RX_AMSDU)) |
1263 | return RX_CONTINUE; | 1263 | return RX_CONTINUE; |
1264 | 1264 | ||
1265 | err = ieee80211_data_to_8023(rx); | 1265 | err = ieee80211_data_to_8023(rx); |
1266 | if (unlikely(err)) | 1266 | if (unlikely(err)) |
1267 | return RX_DROP; | 1267 | return RX_DROP_UNUSABLE; |
1268 | 1268 | ||
1269 | skb->dev = dev; | 1269 | skb->dev = dev; |
1270 | 1270 | ||
@@ -1274,7 +1274,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx) | |||
1274 | /* skip the wrapping header */ | 1274 | /* skip the wrapping header */ |
1275 | eth = (struct ethhdr *) skb_pull(skb, sizeof(struct ethhdr)); | 1275 | eth = (struct ethhdr *) skb_pull(skb, sizeof(struct ethhdr)); |
1276 | if (!eth) | 1276 | if (!eth) |
1277 | return RX_DROP; | 1277 | return RX_DROP_UNUSABLE; |
1278 | 1278 | ||
1279 | while (skb != frame) { | 1279 | while (skb != frame) { |
1280 | u8 padding; | 1280 | u8 padding; |
@@ -1289,7 +1289,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx) | |||
1289 | /* the last MSDU has no padding */ | 1289 | /* the last MSDU has no padding */ |
1290 | if (subframe_len > remaining) { | 1290 | if (subframe_len > remaining) { |
1291 | printk(KERN_DEBUG "%s: wrong buffer size", dev->name); | 1291 | printk(KERN_DEBUG "%s: wrong buffer size", dev->name); |
1292 | return RX_DROP; | 1292 | return RX_DROP_UNUSABLE; |
1293 | } | 1293 | } |
1294 | 1294 | ||
1295 | skb_pull(skb, sizeof(struct ethhdr)); | 1295 | skb_pull(skb, sizeof(struct ethhdr)); |
@@ -1301,7 +1301,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx) | |||
1301 | subframe_len); | 1301 | subframe_len); |
1302 | 1302 | ||
1303 | if (frame == NULL) | 1303 | if (frame == NULL) |
1304 | return RX_DROP; | 1304 | return RX_DROP_UNUSABLE; |
1305 | 1305 | ||
1306 | skb_reserve(frame, local->hw.extra_tx_headroom + | 1306 | skb_reserve(frame, local->hw.extra_tx_headroom + |
1307 | sizeof(struct ethhdr)); | 1307 | sizeof(struct ethhdr)); |
@@ -1314,7 +1314,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx) | |||
1314 | printk(KERN_DEBUG "%s: wrong buffer size ", | 1314 | printk(KERN_DEBUG "%s: wrong buffer size ", |
1315 | dev->name); | 1315 | dev->name); |
1316 | dev_kfree_skb(frame); | 1316 | dev_kfree_skb(frame); |
1317 | return RX_DROP; | 1317 | return RX_DROP_UNUSABLE; |
1318 | } | 1318 | } |
1319 | } | 1319 | } |
1320 | 1320 | ||
@@ -1344,7 +1344,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx) | |||
1344 | 1344 | ||
1345 | if (!ieee80211_frame_allowed(rx)) { | 1345 | if (!ieee80211_frame_allowed(rx)) { |
1346 | if (skb == frame) /* last frame */ | 1346 | if (skb == frame) /* last frame */ |
1347 | return RX_DROP; | 1347 | return RX_DROP_UNUSABLE; |
1348 | dev_kfree_skb(frame); | 1348 | dev_kfree_skb(frame); |
1349 | continue; | 1349 | continue; |
1350 | } | 1350 | } |
@@ -1367,14 +1367,14 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx) | |||
1367 | return RX_CONTINUE; | 1367 | return RX_CONTINUE; |
1368 | 1368 | ||
1369 | if (unlikely(!WLAN_FC_DATA_PRESENT(fc))) | 1369 | if (unlikely(!WLAN_FC_DATA_PRESENT(fc))) |
1370 | return RX_DROP; | 1370 | return RX_DROP_MONITOR; |
1371 | 1371 | ||
1372 | err = ieee80211_data_to_8023(rx); | 1372 | err = ieee80211_data_to_8023(rx); |
1373 | if (unlikely(err)) | 1373 | if (unlikely(err)) |
1374 | return RX_DROP; | 1374 | return RX_DROP_UNUSABLE; |
1375 | 1375 | ||
1376 | if (!ieee80211_frame_allowed(rx)) | 1376 | if (!ieee80211_frame_allowed(rx)) |
1377 | return RX_DROP; | 1377 | return RX_DROP_MONITOR; |
1378 | 1378 | ||
1379 | rx->skb->dev = dev; | 1379 | rx->skb->dev = dev; |
1380 | 1380 | ||
@@ -1423,7 +1423,7 @@ ieee80211_rx_h_ctrl(struct ieee80211_txrx_data *rx) | |||
1423 | ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, NULL, | 1423 | ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, NULL, |
1424 | start_seq_num, 1); | 1424 | start_seq_num, 1); |
1425 | rcu_read_unlock(); | 1425 | rcu_read_unlock(); |
1426 | return RX_DROP; | 1426 | return RX_DROP_UNUSABLE; |
1427 | } | 1427 | } |
1428 | 1428 | ||
1429 | return RX_CONTINUE; | 1429 | return RX_CONTINUE; |
@@ -1435,7 +1435,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_txrx_data *rx) | |||
1435 | struct ieee80211_sub_if_data *sdata; | 1435 | struct ieee80211_sub_if_data *sdata; |
1436 | 1436 | ||
1437 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) | 1437 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) |
1438 | return RX_DROP; | 1438 | return RX_DROP_MONITOR; |
1439 | 1439 | ||
1440 | sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); | 1440 | sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); |
1441 | if ((sdata->vif.type == IEEE80211_IF_TYPE_STA || | 1441 | if ((sdata->vif.type == IEEE80211_IF_TYPE_STA || |
@@ -1443,7 +1443,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_txrx_data *rx) | |||
1443 | !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)) | 1443 | !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)) |
1444 | ieee80211_sta_rx_mgmt(rx->dev, rx->skb, rx->u.rx.status); | 1444 | ieee80211_sta_rx_mgmt(rx->dev, rx->skb, rx->u.rx.status); |
1445 | else | 1445 | else |
1446 | return RX_DROP; | 1446 | return RX_DROP_MONITOR; |
1447 | 1447 | ||
1448 | return RX_QUEUED; | 1448 | return RX_QUEUED; |
1449 | } | 1449 | } |
@@ -1455,7 +1455,7 @@ static inline ieee80211_rx_result __ieee80211_invoke_rx_handlers( | |||
1455 | struct sta_info *sta) | 1455 | struct sta_info *sta) |
1456 | { | 1456 | { |
1457 | ieee80211_rx_handler *handler; | 1457 | ieee80211_rx_handler *handler; |
1458 | ieee80211_rx_result res = RX_DROP; | 1458 | ieee80211_rx_result res = RX_DROP_MONITOR; |
1459 | 1459 | ||
1460 | for (handler = handlers; *handler != NULL; handler++) { | 1460 | for (handler = handlers; *handler != NULL; handler++) { |
1461 | res = (*handler)(rx); | 1461 | res = (*handler)(rx); |
@@ -1463,7 +1463,8 @@ static inline ieee80211_rx_result __ieee80211_invoke_rx_handlers( | |||
1463 | switch (res) { | 1463 | switch (res) { |
1464 | case RX_CONTINUE: | 1464 | case RX_CONTINUE: |
1465 | continue; | 1465 | continue; |
1466 | case RX_DROP: | 1466 | case RX_DROP_UNUSABLE: |
1467 | case RX_DROP_MONITOR: | ||
1467 | I802_DEBUG_INC(local->rx_handlers_drop); | 1468 | I802_DEBUG_INC(local->rx_handlers_drop); |
1468 | if (sta) | 1469 | if (sta) |
1469 | sta->rx_dropped++; | 1470 | sta->rx_dropped++; |
@@ -1475,7 +1476,7 @@ static inline ieee80211_rx_result __ieee80211_invoke_rx_handlers( | |||
1475 | break; | 1476 | break; |
1476 | } | 1477 | } |
1477 | 1478 | ||
1478 | if (res == RX_DROP) | 1479 | if (res == RX_DROP_UNUSABLE || res == RX_DROP_MONITOR) |
1479 | dev_kfree_skb(rx->skb); | 1480 | dev_kfree_skb(rx->skb); |
1480 | return res; | 1481 | return res; |
1481 | } | 1482 | } |
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index 8b0015302645..a33ef5cfa9ad 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
@@ -320,7 +320,7 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx) | |||
320 | printk(KERN_DEBUG "%s: RX WEP frame, decrypt " | 320 | printk(KERN_DEBUG "%s: RX WEP frame, decrypt " |
321 | "failed\n", rx->dev->name); | 321 | "failed\n", rx->dev->name); |
322 | #endif /* CONFIG_MAC80211_DEBUG */ | 322 | #endif /* CONFIG_MAC80211_DEBUG */ |
323 | return RX_DROP; | 323 | return RX_DROP_UNUSABLE; |
324 | } | 324 | } |
325 | } else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) { | 325 | } else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) { |
326 | ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key); | 326 | ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key); |
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index c628fa93f574..b35e51c6ce0c 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -148,7 +148,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx) | |||
148 | 148 | ||
149 | if (ieee80211_get_hdr_info(skb, &sa, &da, &qos_tid, &data, &data_len) | 149 | if (ieee80211_get_hdr_info(skb, &sa, &da, &qos_tid, &data, &data_len) |
150 | || data_len < MICHAEL_MIC_LEN) | 150 | || data_len < MICHAEL_MIC_LEN) |
151 | return RX_DROP; | 151 | return RX_DROP_UNUSABLE; |
152 | 152 | ||
153 | data_len -= MICHAEL_MIC_LEN; | 153 | data_len -= MICHAEL_MIC_LEN; |
154 | 154 | ||
@@ -162,14 +162,14 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx) | |||
162 | michael_mic(key, da, sa, qos_tid & 0x0f, data, data_len, mic); | 162 | michael_mic(key, da, sa, qos_tid & 0x0f, data, data_len, mic); |
163 | if (memcmp(mic, data + data_len, MICHAEL_MIC_LEN) != 0 || wpa_test) { | 163 | if (memcmp(mic, data + data_len, MICHAEL_MIC_LEN) != 0 || wpa_test) { |
164 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) | 164 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) |
165 | return RX_DROP; | 165 | return RX_DROP_UNUSABLE; |
166 | 166 | ||
167 | printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " | 167 | printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " |
168 | "%s\n", rx->dev->name, print_mac(mac, sa)); | 168 | "%s\n", rx->dev->name, print_mac(mac, sa)); |
169 | 169 | ||
170 | mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, | 170 | mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, |
171 | (void *) skb->data); | 171 | (void *) skb->data); |
172 | return RX_DROP; | 172 | return RX_DROP_UNUSABLE; |
173 | } | 173 | } |
174 | 174 | ||
175 | /* remove Michael MIC from payload */ | 175 | /* remove Michael MIC from payload */ |
@@ -293,7 +293,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx) | |||
293 | return RX_CONTINUE; | 293 | return RX_CONTINUE; |
294 | 294 | ||
295 | if (!rx->sta || skb->len - hdrlen < 12) | 295 | if (!rx->sta || skb->len - hdrlen < 12) |
296 | return RX_DROP; | 296 | return RX_DROP_UNUSABLE; |
297 | 297 | ||
298 | if (rx->u.rx.status->flag & RX_FLAG_DECRYPTED) { | 298 | if (rx->u.rx.status->flag & RX_FLAG_DECRYPTED) { |
299 | if (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED) { | 299 | if (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED) { |
@@ -322,7 +322,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx) | |||
322 | "frame from %s (res=%d)\n", rx->dev->name, | 322 | "frame from %s (res=%d)\n", rx->dev->name, |
323 | print_mac(mac, rx->sta->addr), res); | 323 | print_mac(mac, rx->sta->addr), res); |
324 | #endif /* CONFIG_MAC80211_DEBUG */ | 324 | #endif /* CONFIG_MAC80211_DEBUG */ |
325 | return RX_DROP; | 325 | return RX_DROP_UNUSABLE; |
326 | } | 326 | } |
327 | 327 | ||
328 | /* Trim ICV */ | 328 | /* Trim ICV */ |
@@ -545,7 +545,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
545 | 545 | ||
546 | data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN; | 546 | data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN; |
547 | if (!rx->sta || data_len < 0) | 547 | if (!rx->sta || data_len < 0) |
548 | return RX_DROP; | 548 | return RX_DROP_UNUSABLE; |
549 | 549 | ||
550 | if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && | 550 | if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && |
551 | (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) | 551 | (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) |
@@ -565,7 +565,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
565 | ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]); | 565 | ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]); |
566 | #endif /* CONFIG_MAC80211_DEBUG */ | 566 | #endif /* CONFIG_MAC80211_DEBUG */ |
567 | key->u.ccmp.replays++; | 567 | key->u.ccmp.replays++; |
568 | return RX_DROP; | 568 | return RX_DROP_UNUSABLE; |
569 | } | 569 | } |
570 | 570 | ||
571 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { | 571 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { |
@@ -589,7 +589,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
589 | "for RX frame from %s\n", rx->dev->name, | 589 | "for RX frame from %s\n", rx->dev->name, |
590 | print_mac(mac, rx->sta->addr)); | 590 | print_mac(mac, rx->sta->addr)); |
591 | #endif /* CONFIG_MAC80211_DEBUG */ | 591 | #endif /* CONFIG_MAC80211_DEBUG */ |
592 | return RX_DROP; | 592 | return RX_DROP_UNUSABLE; |
593 | } | 593 | } |
594 | } | 594 | } |
595 | 595 | ||