diff options
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 441383ced931..af94fb597415 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -221,7 +221,7 @@ ieee80211_rx_h_passive_scan(struct ieee80211_txrx_data *rx) | |||
221 | return TXRX_QUEUED; | 221 | return TXRX_QUEUED; |
222 | } | 222 | } |
223 | 223 | ||
224 | if (unlikely(rx->u.rx.in_scan)) { | 224 | if (unlikely(rx->flags & IEEE80211_TXRXD_RXIN_SCAN)) { |
225 | /* scanning finished during invoking of handlers */ | 225 | /* scanning finished during invoking of handlers */ |
226 | I802_DEBUG_INC(local->rx_handlers_drop_passive_scan); | 226 | I802_DEBUG_INC(local->rx_handlers_drop_passive_scan); |
227 | return TXRX_DROP; | 227 | return TXRX_DROP; |
@@ -241,7 +241,7 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx) | |||
241 | if (unlikely(rx->fc & IEEE80211_FCTL_RETRY && | 241 | if (unlikely(rx->fc & IEEE80211_FCTL_RETRY && |
242 | rx->sta->last_seq_ctrl[rx->u.rx.queue] == | 242 | rx->sta->last_seq_ctrl[rx->u.rx.queue] == |
243 | hdr->seq_ctrl)) { | 243 | hdr->seq_ctrl)) { |
244 | if (rx->u.rx.ra_match) { | 244 | if (rx->flags & IEEE80211_TXRXD_RXRA_MATCH) { |
245 | rx->local->dot11FrameDuplicateCount++; | 245 | rx->local->dot11FrameDuplicateCount++; |
246 | rx->sta->num_duplicates++; | 246 | rx->sta->num_duplicates++; |
247 | } | 247 | } |
@@ -259,7 +259,7 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx) | |||
259 | return TXRX_DROP; | 259 | return TXRX_DROP; |
260 | } | 260 | } |
261 | 261 | ||
262 | if (!rx->u.rx.ra_match) | 262 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) |
263 | rx->skb->pkt_type = PACKET_OTHERHOST; | 263 | rx->skb->pkt_type = PACKET_OTHERHOST; |
264 | else if (compare_ether_addr(rx->dev->dev_addr, hdr->addr1) == 0) | 264 | else if (compare_ether_addr(rx->dev->dev_addr, hdr->addr1) == 0) |
265 | rx->skb->pkt_type = PACKET_HOST; | 265 | rx->skb->pkt_type = PACKET_HOST; |
@@ -287,7 +287,7 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx) | |||
287 | if ((!(rx->fc & IEEE80211_FCTL_FROMDS) && | 287 | if ((!(rx->fc & IEEE80211_FCTL_FROMDS) && |
288 | !(rx->fc & IEEE80211_FCTL_TODS) && | 288 | !(rx->fc & IEEE80211_FCTL_TODS) && |
289 | (rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) | 289 | (rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) |
290 | || !rx->u.rx.ra_match) { | 290 | || !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) { |
291 | /* Drop IBSS frames and frames for other hosts | 291 | /* Drop IBSS frames and frames for other hosts |
292 | * silently. */ | 292 | * silently. */ |
293 | return TXRX_DROP; | 293 | return TXRX_DROP; |
@@ -338,7 +338,7 @@ ieee80211_rx_h_load_key(struct ieee80211_txrx_data *rx) | |||
338 | * No point in finding a key if the frame is neither | 338 | * No point in finding a key if the frame is neither |
339 | * addressed to us nor a multicast frame. | 339 | * addressed to us nor a multicast frame. |
340 | */ | 340 | */ |
341 | if (!rx->u.rx.ra_match) | 341 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) |
342 | return TXRX_CONTINUE; | 342 | return TXRX_CONTINUE; |
343 | 343 | ||
344 | if (!is_multicast_ether_addr(hdr->addr1) && rx->sta && rx->sta->key) { | 344 | if (!is_multicast_ether_addr(hdr->addr1) && rx->sta && rx->sta->key) { |
@@ -480,7 +480,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_txrx_data *rx) | |||
480 | sta->last_rx = jiffies; | 480 | sta->last_rx = jiffies; |
481 | } | 481 | } |
482 | 482 | ||
483 | if (!rx->u.rx.ra_match) | 483 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) |
484 | return TXRX_CONTINUE; | 484 | return TXRX_CONTINUE; |
485 | 485 | ||
486 | sta->rx_fragments++; | 486 | sta->rx_fragments++; |
@@ -522,7 +522,8 @@ ieee80211_rx_h_wep_weak_iv_detection(struct ieee80211_txrx_data *rx) | |||
522 | { | 522 | { |
523 | if (!rx->sta || !(rx->fc & IEEE80211_FCTL_PROTECTED) || | 523 | if (!rx->sta || !(rx->fc & IEEE80211_FCTL_PROTECTED) || |
524 | (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA || | 524 | (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA || |
525 | !rx->key || rx->key->alg != ALG_WEP || !rx->u.rx.ra_match) | 525 | !rx->key || rx->key->alg != ALG_WEP || |
526 | !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) | ||
526 | return TXRX_CONTINUE; | 527 | return TXRX_CONTINUE; |
527 | 528 | ||
528 | /* Check for weak IVs, if hwaccel did not remove IV from the frame */ | 529 | /* Check for weak IVs, if hwaccel did not remove IV from the frame */ |
@@ -755,7 +756,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) | |||
755 | } | 756 | } |
756 | 757 | ||
757 | /* Complete frame has been reassembled - process it now */ | 758 | /* Complete frame has been reassembled - process it now */ |
758 | rx->fragmented = 1; | 759 | rx->flags |= IEEE80211_TXRXD_FRAGMENTED; |
759 | 760 | ||
760 | out: | 761 | out: |
761 | if (rx->sta) | 762 | if (rx->sta) |
@@ -776,7 +777,7 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx) | |||
776 | if (likely(!rx->sta || | 777 | if (likely(!rx->sta || |
777 | (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL || | 778 | (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL || |
778 | (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_PSPOLL || | 779 | (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_PSPOLL || |
779 | !rx->u.rx.ra_match)) | 780 | !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH))) |
780 | return TXRX_CONTINUE; | 781 | return TXRX_CONTINUE; |
781 | 782 | ||
782 | skb = skb_dequeue(&rx->sta->tx_filtered); | 783 | skb = skb_dequeue(&rx->sta->tx_filtered); |
@@ -860,7 +861,8 @@ static ieee80211_txrx_result | |||
860 | ieee80211_rx_h_802_1x_pae(struct ieee80211_txrx_data *rx) | 861 | ieee80211_rx_h_802_1x_pae(struct ieee80211_txrx_data *rx) |
861 | { | 862 | { |
862 | if (rx->sdata->eapol && ieee80211_is_eapol(rx->skb) && | 863 | if (rx->sdata->eapol && ieee80211_is_eapol(rx->skb) && |
863 | rx->sdata->type != IEEE80211_IF_TYPE_STA && rx->u.rx.ra_match) { | 864 | rx->sdata->type != IEEE80211_IF_TYPE_STA && |
865 | (rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) { | ||
864 | /* Pass both encrypted and unencrypted EAPOL frames to user | 866 | /* Pass both encrypted and unencrypted EAPOL frames to user |
865 | * space for processing. */ | 867 | * space for processing. */ |
866 | if (!rx->local->apdev) | 868 | if (!rx->local->apdev) |
@@ -1053,7 +1055,8 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx) | |||
1053 | sdata->stats.rx_bytes += skb->len; | 1055 | sdata->stats.rx_bytes += skb->len; |
1054 | 1056 | ||
1055 | if (local->bridge_packets && (sdata->type == IEEE80211_IF_TYPE_AP | 1057 | if (local->bridge_packets && (sdata->type == IEEE80211_IF_TYPE_AP |
1056 | || sdata->type == IEEE80211_IF_TYPE_VLAN) && rx->u.rx.ra_match) { | 1058 | || sdata->type == IEEE80211_IF_TYPE_VLAN) && |
1059 | (rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) { | ||
1057 | if (is_multicast_ether_addr(skb->data)) { | 1060 | if (is_multicast_ether_addr(skb->data)) { |
1058 | /* send multicast frames both to higher layers in | 1061 | /* send multicast frames both to higher layers in |
1059 | * local net stack and back to the wireless media */ | 1062 | * local net stack and back to the wireless media */ |
@@ -1104,7 +1107,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_txrx_data *rx) | |||
1104 | { | 1107 | { |
1105 | struct ieee80211_sub_if_data *sdata; | 1108 | struct ieee80211_sub_if_data *sdata; |
1106 | 1109 | ||
1107 | if (!rx->u.rx.ra_match) | 1110 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) |
1108 | return TXRX_DROP; | 1111 | return TXRX_DROP; |
1109 | 1112 | ||
1110 | sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); | 1113 | sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); |
@@ -1279,30 +1282,30 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1279 | if (!bssid) | 1282 | if (!bssid) |
1280 | return 0; | 1283 | return 0; |
1281 | if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { | 1284 | if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { |
1282 | if (!rx->u.rx.in_scan) | 1285 | if (!(rx->flags & IEEE80211_TXRXD_RXIN_SCAN)) |
1283 | return 0; | 1286 | return 0; |
1284 | rx->u.rx.ra_match = 0; | 1287 | rx->flags &= ~IEEE80211_TXRXD_RXRA_MATCH; |
1285 | } else if (!multicast && | 1288 | } else if (!multicast && |
1286 | compare_ether_addr(sdata->dev->dev_addr, | 1289 | compare_ether_addr(sdata->dev->dev_addr, |
1287 | hdr->addr1) != 0) { | 1290 | hdr->addr1) != 0) { |
1288 | if (!sdata->promisc) | 1291 | if (!sdata->promisc) |
1289 | return 0; | 1292 | return 0; |
1290 | rx->u.rx.ra_match = 0; | 1293 | rx->flags &= ~IEEE80211_TXRXD_RXRA_MATCH; |
1291 | } | 1294 | } |
1292 | break; | 1295 | break; |
1293 | case IEEE80211_IF_TYPE_IBSS: | 1296 | case IEEE80211_IF_TYPE_IBSS: |
1294 | if (!bssid) | 1297 | if (!bssid) |
1295 | return 0; | 1298 | return 0; |
1296 | if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { | 1299 | if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { |
1297 | if (!rx->u.rx.in_scan) | 1300 | if (!(rx->flags & IEEE80211_TXRXD_RXIN_SCAN)) |
1298 | return 0; | 1301 | return 0; |
1299 | rx->u.rx.ra_match = 0; | 1302 | rx->flags &= ~IEEE80211_TXRXD_RXRA_MATCH; |
1300 | } else if (!multicast && | 1303 | } else if (!multicast && |
1301 | compare_ether_addr(sdata->dev->dev_addr, | 1304 | compare_ether_addr(sdata->dev->dev_addr, |
1302 | hdr->addr1) != 0) { | 1305 | hdr->addr1) != 0) { |
1303 | if (!sdata->promisc) | 1306 | if (!sdata->promisc) |
1304 | return 0; | 1307 | return 0; |
1305 | rx->u.rx.ra_match = 0; | 1308 | rx->flags &= ~IEEE80211_TXRXD_RXRA_MATCH; |
1306 | } else if (!rx->sta) | 1309 | } else if (!rx->sta) |
1307 | rx->sta = ieee80211_ibss_add_sta(sdata->dev, rx->skb, | 1310 | rx->sta = ieee80211_ibss_add_sta(sdata->dev, rx->skb, |
1308 | bssid, hdr->addr2); | 1311 | bssid, hdr->addr2); |
@@ -1314,11 +1317,12 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1314 | return 0; | 1317 | return 0; |
1315 | } else if (!ieee80211_bssid_match(bssid, | 1318 | } else if (!ieee80211_bssid_match(bssid, |
1316 | sdata->dev->dev_addr)) { | 1319 | sdata->dev->dev_addr)) { |
1317 | if (!rx->u.rx.in_scan) | 1320 | if (!(rx->flags & IEEE80211_TXRXD_RXIN_SCAN)) |
1318 | return 0; | 1321 | return 0; |
1319 | rx->u.rx.ra_match = 0; | 1322 | rx->flags &= ~IEEE80211_TXRXD_RXRA_MATCH; |
1320 | } | 1323 | } |
1321 | if (sdata->dev == sdata->local->mdev && !rx->u.rx.in_scan) | 1324 | if (sdata->dev == sdata->local->mdev && |
1325 | !(rx->flags & IEEE80211_TXRXD_RXIN_SCAN)) | ||
1322 | /* do not receive anything via | 1326 | /* do not receive anything via |
1323 | * master device when not scanning */ | 1327 | * master device when not scanning */ |
1324 | return 0; | 1328 | return 0; |
@@ -1384,7 +1388,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1384 | } | 1388 | } |
1385 | 1389 | ||
1386 | if (unlikely(local->sta_scanning)) | 1390 | if (unlikely(local->sta_scanning)) |
1387 | rx.u.rx.in_scan = 1; | 1391 | rx.flags |= IEEE80211_TXRXD_RXIN_SCAN; |
1388 | 1392 | ||
1389 | if (__ieee80211_invoke_rx_handlers(local, local->rx_pre_handlers, &rx, | 1393 | if (__ieee80211_invoke_rx_handlers(local, local->rx_pre_handlers, &rx, |
1390 | sta) != TXRX_CONTINUE) | 1394 | sta) != TXRX_CONTINUE) |
@@ -1394,7 +1398,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1394 | skb_push(skb, radiotap_len); | 1398 | skb_push(skb, radiotap_len); |
1395 | if (sta && !sta->assoc_ap && !(sta->flags & WLAN_STA_WDS) && | 1399 | if (sta && !sta->assoc_ap && !(sta->flags & WLAN_STA_WDS) && |
1396 | !local->iff_promiscs && !is_multicast_ether_addr(hdr->addr1)) { | 1400 | !local->iff_promiscs && !is_multicast_ether_addr(hdr->addr1)) { |
1397 | rx.u.rx.ra_match = 1; | 1401 | rx.flags |= IEEE80211_TXRXD_RXRA_MATCH; |
1398 | ieee80211_invoke_rx_handlers(local, local->rx_handlers, &rx, | 1402 | ieee80211_invoke_rx_handlers(local, local->rx_handlers, &rx, |
1399 | rx.sta); | 1403 | rx.sta); |
1400 | sta_info_put(sta); | 1404 | sta_info_put(sta); |
@@ -1405,7 +1409,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1405 | 1409 | ||
1406 | read_lock(&local->sub_if_lock); | 1410 | read_lock(&local->sub_if_lock); |
1407 | list_for_each_entry(sdata, &local->sub_if_list, list) { | 1411 | list_for_each_entry(sdata, &local->sub_if_list, list) { |
1408 | rx.u.rx.ra_match = 1; | 1412 | rx.flags |= IEEE80211_TXRXD_RXRA_MATCH; |
1409 | 1413 | ||
1410 | if (!netif_running(sdata->dev)) | 1414 | if (!netif_running(sdata->dev)) |
1411 | continue; | 1415 | continue; |