mac80211: backport upstream fixes
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / subsys / 366-mac80211-accept-deauth-frames-in-IBSS-mode.patch
1 From 95697f9907bfe3eab0ef20265a766b22e27dde64 Mon Sep 17 00:00:00 2001
2 From: Johannes Berg <johannes.berg@intel.com>
3 Date: Fri, 4 Oct 2019 15:37:05 +0300
4 Subject: [PATCH] mac80211: accept deauth frames in IBSS mode
5
6 We can process deauth frames and all, but we drop them very
7 early in the RX path today - this could never have worked.
8
9 Fixes: 2cc59e784b54 ("mac80211: reply to AUTH with DEAUTH if sta allocation fails in IBSS")
10 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
12 Link: https://lore.kernel.org/r/20191004123706.15768-2-luca@coelho.fi
13 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
14 ---
15 net/mac80211/rx.c | 11 ++++++++++-
16 1 file changed, 10 insertions(+), 1 deletion(-)
17
18 --- a/net/mac80211/rx.c
19 +++ b/net/mac80211/rx.c
20 @@ -3407,9 +3407,18 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_
21 case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
22 /* process for all: mesh, mlme, ibss */
23 break;
24 + case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
25 + if (is_multicast_ether_addr(mgmt->da) &&
26 + !is_broadcast_ether_addr(mgmt->da))
27 + return RX_DROP_MONITOR;
28 +
29 + /* process only for station/IBSS */
30 + if (sdata->vif.type != NL80211_IFTYPE_STATION &&
31 + sdata->vif.type != NL80211_IFTYPE_ADHOC)
32 + return RX_DROP_MONITOR;
33 + break;
34 case cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP):
35 case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP):
36 - case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
37 case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
38 if (is_multicast_ether_addr(mgmt->da) &&
39 !is_broadcast_ether_addr(mgmt->da))