[PATCH wireless] wifi: mac80211: drop the monitor filter counts on stop, not just sometimes
Devin Wittmayer <[email protected]>
| Newsgroups | org.kernel.vger.linux-wireless,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Bringing a monitor up raises the filter counts that track what userspace
asked to see: frames that failed their checksum, control frames, other-BSS
traffic. Taking it down again should lower them.
The rise happens for every monitor. The fall sits inside the branch that
retires the virtual monitor, so it is skipped for an active monitor, and
on any driver setting NO_VIRTUAL_MONITOR. For those, every up and down
leaves another increment behind.
So once anything has asked to see frames that failed their checksum, the
hardware keeps handing them up long afterwards, to monitors that never
asked for them. The other counts accumulate the same way, including the
one that keeps TX status reporting armed once it has been used.
Changing the flags on a running monitor still balances, so the
accumulation boils down to the open and stop pair.
Reproduced on mac80211_hwsim: an active monitor brought up and down
leaves one unmatched increment behind, while a passive monitor on the
same phy balances.
The two sides matched until cooked monitor support was taken off the
heat. The decrement got baked into the new conditional along with the
virtual monitor bookkeeping and never came back out. Move it out again
so it mirrors the increment.
Fixes: 286e69677065 ("wifi: mac80211: Drop cooked monitor support")
Cc: [email protected]
Signed-off-by: Devin Wittmayer <[email protected]>
---
net/mac80211/iface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 43460a705a6b..6fc01d85eea9 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -629,9 +629,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
local->hw.conf.flags &= ~IEEE80211_CONF_MONITOR;
hw_reconf_flags |= IEEE80211_CONF_CHANGE_MONITOR;
}
-
- ieee80211_adjust_monitor_flags(sdata, -1);
}
+
+ ieee80211_adjust_monitor_flags(sdata, -1);
break;
case NL80211_IFTYPE_NAN:
/* Check if any open NAN_DATA interfaces */
--
2.55.0