1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Mon, 21 Sep 2020 17:43:06 +0200
3 Subject: [PATCH] mac80211: fix regression in sta connection monitor
5 When a frame was acked and probe frames were sent, the connection monitoring
6 needs to be reset, otherwise it will keep probing until the connection is
7 considered dead, even though frames have been acked in the mean time.
9 Fixes: 9abf4e49830d ("mac80211: optimize station connection monitor")
10 Reported-by: Georgi Valkov <gvalkov@abv.bg>
11 Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 --- a/net/mac80211/status.c
15 +++ b/net/mac80211/status.c
16 @@ -1129,6 +1129,8 @@ void ieee80211_tx_status_ext(struct ieee
17 noack_success = !!(info->flags & IEEE80211_TX_STAT_NOACK_TRANSMITTED);
20 + struct ieee80211_sub_if_data *sdata = sta->sdata;
22 if (!acked && !noack_success)
23 sta->status_stats.retry_failed++;
24 sta->status_stats.retry_count += retry_count;
25 @@ -1143,6 +1145,13 @@ void ieee80211_tx_status_ext(struct ieee
26 /* Track when last packet was ACKed */
27 sta->status_stats.last_pkt_time = jiffies;
29 + /* Reset connection monitor */
30 + if (sdata->vif.type == NL80211_IFTYPE_STATION &&
31 + unlikely(sdata->u.mgd.probe_send_count > 0)) {
32 + sdata->u.mgd.probe_send_count = 0;
33 + ieee80211_queue_work(&local->hw, &sdata->work);
36 if (info->status.is_valid_ack_signal) {
37 sta->status_stats.last_ack_signal =
38 (s8)info->status.ack_signal;