relayd: update to the latest version, fixes some issues found by Coverity
[openwrt/staging/chunkeey.git] / package / kernel / mac80211 / patches / 335-mac80211-fix-handling-of-PS-filtering-with-fast-xmit.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Thu, 24 Sep 2015 14:11:40 +0200
3 Subject: [PATCH] mac80211: fix handling of PS filtering with fast-xmit
4
5 Fixes dropped packets in the tx path in case a non-PS station triggers
6 the tx filter.
7
8 Cc: stable@vger.kernel.org # 4.2
9 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 ---
11
12 --- a/net/mac80211/status.c
13 +++ b/net/mac80211/status.c
14 @@ -101,6 +101,7 @@ static void ieee80211_handle_filtered_fr
15 * when it wakes up for the next time.
16 */
17 set_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT);
18 + ieee80211_clear_fast_xmit(sta);
19
20 /*
21 * This code races in the following way:
22 --- a/net/mac80211/tx.c
23 +++ b/net/mac80211/tx.c
24 @@ -1217,8 +1217,10 @@ ieee80211_tx_prepare(struct ieee80211_su
25
26 if (!tx->sta)
27 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
28 - else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT))
29 + else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) {
30 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
31 + ieee80211_check_fast_xmit(tx->sta);
32 + }
33
34 info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT;
35
36 @@ -2450,7 +2452,8 @@ void ieee80211_check_fast_xmit(struct st
37
38 if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
39 test_sta_flag(sta, WLAN_STA_PS_DRIVER) ||
40 - test_sta_flag(sta, WLAN_STA_PS_DELIVER))
41 + test_sta_flag(sta, WLAN_STA_PS_DELIVER) ||
42 + test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT))
43 goto out;
44
45 if (sdata->noack_map)