On 2/4/2025 4:43 PM, Alexander Wetzel wrote:
Hostapd switched from cooked monitor interfaces to nl80211 Dec 2011.
Drop support for the outdated cooked monitor interfaces and fix
creating the virtual monitor interfaces in the following cases:
1) We have one non-monitor and one monitor interface with
%MONITOR_FLAG_ACTIVE enabled and then delete the non-monitor
interface.
2) We only have monitor interfaces enabled on resume while at least one
has %MONITOR_FLAG_ACTIVE set.
Signed-off-by: Alexander Wetzel <Alexander@xxxxxxxxxxxxxx>
---
Checkpatch is kind of unhappy here:
ERROR: Macros with complex values should be enclosed in parentheses
#285: FILE: net/mac80211/main.c:1747:
+#define V(x) #x,
I don't see how to get rid of that error and more or less accidentially
moved the line when cleaning up.
Since the code is from commit baa951a1c177 ("mac80211: use the new drop
reasons infrastructure") from 2023 I assume it's one of the rare cases
where we can ignore an error?
---
include/net/dropreason.h | 6 --
net/mac80211/cfg.c | 9 +-
net/mac80211/drop.h | 21 ++--
net/mac80211/ieee80211_i.h | 11 +--
net/mac80211/iface.c | 50 ++++------
net/mac80211/main.c | 16 +--
net/mac80211/rx.c | 194 ++++++++++---------------------------
net/mac80211/status.c | 34 +------
net/mac80211/tx.c | 2 +-
9 files changed, 94 insertions(+), 249 deletions(-)
...
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 0ea7e77860b7..7d3ebfcb8c2b 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
...
@@ -1326,27 +1323,24 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
}
break;
case NL80211_IFTYPE_MONITOR:
- if (sdata->u.mntr.flags & MONITOR_FLAG_COOK_FRAMES) {
- local->cooked_mntrs++;
- break;
- }
-
if ((sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) ||
ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) {
res = drv_add_interface(local, sdata);
if (res)
goto err_stop;
- } else if (local->monitors == 0 && local->open_count == 0) {
- res = ieee80211_add_virtual_monitor(local);
- if (res)
- goto err_stop;
- }
+ } else {
+ if (local->monitors == 0 && local->open_count == 0) {
+ res = ieee80211_add_virtual_monitor(local);
+ if (res)
+ goto err_stop;
+ }
+ local->monitors++;
- /* must be before the call to ieee80211_configure_filter */
- local->monitors++;
Regression on NO_VIRTUAL_MONITOR support drivers.
Here local->monitors increment not done for NO_VIRTUAL_MONITOR.
Which causing packet drop in Rx path (code snip below)
net/mac80211/rx.c: ieee80211_rx_monitor()
if (!local->monitors || (status->flag & RX_FLAG_SKIP_MONITOR)) {
if (only_monitor) {
dev_kfree_skb(origskb);
return NULL;
}
return ieee80211_clean_skb(origskb, present_fcs_len,
rtap_space);
}
--
Karthikeyan Periyasamy
--
கார்த்திகேயன் பெரியசாமி