diff options
-rw-r--r-- | net/mac80211/rx.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index a6080d8d72bb..b5c48de81d8b 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1397,6 +1397,21 @@ ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc) | |||
1397 | ieee80211_is_data(fc) && | 1397 | ieee80211_is_data(fc) && |
1398 | (rx->key || rx->sdata->drop_unencrypted))) | 1398 | (rx->key || rx->sdata->drop_unencrypted))) |
1399 | return -EACCES; | 1399 | return -EACCES; |
1400 | |||
1401 | return 0; | ||
1402 | } | ||
1403 | |||
1404 | static int | ||
1405 | ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx) | ||
1406 | { | ||
1407 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; | ||
1408 | __le16 fc = hdr->frame_control; | ||
1409 | int res; | ||
1410 | |||
1411 | res = ieee80211_drop_unencrypted(rx, fc); | ||
1412 | if (unlikely(res)) | ||
1413 | return res; | ||
1414 | |||
1400 | if (rx->sta && test_sta_flags(rx->sta, WLAN_STA_MFP)) { | 1415 | if (rx->sta && test_sta_flags(rx->sta, WLAN_STA_MFP)) { |
1401 | if (unlikely(ieee80211_is_unicast_robust_mgmt_frame(rx->skb) && | 1416 | if (unlikely(ieee80211_is_unicast_robust_mgmt_frame(rx->skb) && |
1402 | rx->key)) | 1417 | rx->key)) |
@@ -1872,7 +1887,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) | |||
1872 | if (!(rx->flags & IEEE80211_RX_RA_MATCH)) | 1887 | if (!(rx->flags & IEEE80211_RX_RA_MATCH)) |
1873 | return RX_DROP_UNUSABLE; | 1888 | return RX_DROP_UNUSABLE; |
1874 | 1889 | ||
1875 | if (ieee80211_drop_unencrypted(rx, mgmt->frame_control)) | 1890 | if (ieee80211_drop_unencrypted_mgmt(rx)) |
1876 | return RX_DROP_UNUSABLE; | 1891 | return RX_DROP_UNUSABLE; |
1877 | 1892 | ||
1878 | switch (mgmt->u.action.category) { | 1893 | switch (mgmt->u.action.category) { |
@@ -2014,14 +2029,13 @@ static ieee80211_rx_result debug_noinline | |||
2014 | ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) | 2029 | ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) |
2015 | { | 2030 | { |
2016 | struct ieee80211_sub_if_data *sdata = rx->sdata; | 2031 | struct ieee80211_sub_if_data *sdata = rx->sdata; |
2017 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; | ||
2018 | ieee80211_rx_result rxs; | 2032 | ieee80211_rx_result rxs; |
2019 | 2033 | ||
2020 | if (!(rx->flags & IEEE80211_RX_RA_MATCH)) | 2034 | if (!(rx->flags & IEEE80211_RX_RA_MATCH)) |
2021 | return RX_DROP_MONITOR; | 2035 | return RX_DROP_MONITOR; |
2022 | 2036 | ||
2023 | if (ieee80211_drop_unencrypted(rx, mgmt->frame_control)) | 2037 | if (ieee80211_drop_unencrypted_mgmt(rx)) |
2024 | return RX_DROP_MONITOR; | 2038 | return RX_DROP_UNUSABLE; |
2025 | 2039 | ||
2026 | rxs = ieee80211_work_rx_mgmt(rx->sdata, rx->skb); | 2040 | rxs = ieee80211_work_rx_mgmt(rx->sdata, rx->skb); |
2027 | if (rxs != RX_CONTINUE) | 2041 | if (rxs != RX_CONTINUE) |