mac80211: add fixes for dealing with unexpected BlockAck frames
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch
1 From: Johannes Berg <johannes.berg@intel.com>
2 Date: Mon, 29 Aug 2016 23:25:19 +0300
3 Subject: [PATCH] mac80211: send delBA on unexpected BlockAck Request
4
5 If we don't have a BA session, send delBA, as requested by the
6 IEEE 802.11 spec. Apply the same limit of sending such a delBA
7 only once as in the previous patch.
8
9 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 ---
11
12 --- a/net/mac80211/rx.c
13 +++ b/net/mac80211/rx.c
14 @@ -2537,6 +2537,12 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_
15
16 tid = le16_to_cpu(bar_data.control) >> 12;
17
18 + if (!test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) &&
19 + !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg))
20 + ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid,
21 + WLAN_BACK_RECIPIENT,
22 + WLAN_REASON_QSTA_REQUIRE_SETUP);
23 +
24 tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]);
25 if (!tid_agg_rx)
26 return RX_DROP_MONITOR;