aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b5ee0847a7e1..3ab85c02ef04 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -859,7 +859,12 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx)
859 rx->sdata->vif.type != NL80211_IFTYPE_ADHOC && 859 rx->sdata->vif.type != NL80211_IFTYPE_ADHOC &&
860 rx->sdata->vif.type != NL80211_IFTYPE_WDS && 860 rx->sdata->vif.type != NL80211_IFTYPE_WDS &&
861 (!rx->sta || !test_sta_flag(rx->sta, WLAN_STA_ASSOC)))) { 861 (!rx->sta || !test_sta_flag(rx->sta, WLAN_STA_ASSOC)))) {
862 if (rx->sta && rx->sta->dummy && 862 /*
863 * accept port control frames from the AP even when it's not
864 * yet marked ASSOC to prevent a race where we don't set the
865 * assoc bit quickly enough before it sends the first frame
866 */
867 if (rx->sta && rx->sdata->vif.type == NL80211_IFTYPE_STATION &&
863 ieee80211_is_data_present(hdr->frame_control)) { 868 ieee80211_is_data_present(hdr->frame_control)) {
864 u16 ethertype; 869 u16 ethertype;
865 u8 *payload; 870 u8 *payload;
@@ -2479,14 +2484,9 @@ static ieee80211_rx_result debug_noinline
2479ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) 2484ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
2480{ 2485{
2481 struct ieee80211_sub_if_data *sdata = rx->sdata; 2486 struct ieee80211_sub_if_data *sdata = rx->sdata;
2482 ieee80211_rx_result rxs;
2483 struct ieee80211_mgmt *mgmt = (void *)rx->skb->data; 2487 struct ieee80211_mgmt *mgmt = (void *)rx->skb->data;
2484 __le16 stype; 2488 __le16 stype;
2485 2489
2486 rxs = ieee80211_work_rx_mgmt(rx->sdata, rx->skb);
2487 if (rxs != RX_CONTINUE)
2488 return rxs;
2489
2490 stype = mgmt->frame_control & cpu_to_le16(IEEE80211_FCTL_STYPE); 2490 stype = mgmt->frame_control & cpu_to_le16(IEEE80211_FCTL_STYPE);
2491 2491
2492 if (!ieee80211_vif_is_mesh(&sdata->vif) && 2492 if (!ieee80211_vif_is_mesh(&sdata->vif) &&
@@ -2495,10 +2495,13 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
2495 return RX_DROP_MONITOR; 2495 return RX_DROP_MONITOR;
2496 2496
2497 switch (stype) { 2497 switch (stype) {
2498 case cpu_to_le16(IEEE80211_STYPE_AUTH):
2498 case cpu_to_le16(IEEE80211_STYPE_BEACON): 2499 case cpu_to_le16(IEEE80211_STYPE_BEACON):
2499 case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP): 2500 case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
2500 /* process for all: mesh, mlme, ibss */ 2501 /* process for all: mesh, mlme, ibss */
2501 break; 2502 break;
2503 case cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP):
2504 case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP):
2502 case cpu_to_le16(IEEE80211_STYPE_DEAUTH): 2505 case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
2503 case cpu_to_le16(IEEE80211_STYPE_DISASSOC): 2506 case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
2504 if (is_multicast_ether_addr(mgmt->da) && 2507 if (is_multicast_ether_addr(mgmt->da) &&
@@ -2510,7 +2513,6 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
2510 return RX_DROP_MONITOR; 2513 return RX_DROP_MONITOR;
2511 break; 2514 break;
2512 case cpu_to_le16(IEEE80211_STYPE_PROBE_REQ): 2515 case cpu_to_le16(IEEE80211_STYPE_PROBE_REQ):
2513 case cpu_to_le16(IEEE80211_STYPE_AUTH):
2514 /* process only for ibss */ 2516 /* process only for ibss */
2515 if (sdata->vif.type != NL80211_IFTYPE_ADHOC) 2517 if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
2516 return RX_DROP_MONITOR; 2518 return RX_DROP_MONITOR;
@@ -2949,7 +2951,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
2949 if (ieee80211_is_data(fc)) { 2951 if (ieee80211_is_data(fc)) {
2950 prev_sta = NULL; 2952 prev_sta = NULL;
2951 2953
2952 for_each_sta_info_rx(local, hdr->addr2, sta, tmp) { 2954 for_each_sta_info(local, hdr->addr2, sta, tmp) {
2953 if (!prev_sta) { 2955 if (!prev_sta) {
2954 prev_sta = sta; 2956 prev_sta = sta;
2955 continue; 2957 continue;
@@ -2993,7 +2995,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
2993 continue; 2995 continue;
2994 } 2996 }
2995 2997
2996 rx.sta = sta_info_get_bss_rx(prev, hdr->addr2); 2998 rx.sta = sta_info_get_bss(prev, hdr->addr2);
2997 rx.sdata = prev; 2999 rx.sdata = prev;
2998 ieee80211_prepare_and_rx_handle(&rx, skb, false); 3000 ieee80211_prepare_and_rx_handle(&rx, skb, false);
2999 3001
@@ -3001,7 +3003,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
3001 } 3003 }
3002 3004
3003 if (prev) { 3005 if (prev) {
3004 rx.sta = sta_info_get_bss_rx(prev, hdr->addr2); 3006 rx.sta = sta_info_get_bss(prev, hdr->addr2);
3005 rx.sdata = prev; 3007 rx.sdata = prev;
3006 3008
3007 if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) 3009 if (ieee80211_prepare_and_rx_handle(&rx, skb, true))