Linux wireless drivers development
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net
Subject: [PATCH wireless v2 1/4] wifi: mac80211: keep the monitor chanreq empty without a channel
Date: Tue, 10 Nov 2026 19:54:33 +0100	[thread overview]
Message-ID: <20261110185436.2015505-1-nbd@nbd.name> (raw)

ieee80211_do_stop() releases the channel of a monitor, but leaves its
chanreq filled. When the monitor comes back up it has no channel, yet
the RX path still filters on the old chanreq and drops all frames
received on other frequencies.

Only keep the chanreq filled while a channel is set on the monitor.

Fixes: f92e0cf19ae0 ("wifi: mac80211: filter on monitor interfaces based on configured channel")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
v2: drop unnecessary condition for memset

 net/mac80211/cfg.c   | 5 ++++-
 net/mac80211/iface.c | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9608c07bcea7..64e2bd0cf124 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1165,8 +1165,11 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
 	ieee80211_link_release_channel(&sdata->deflink);
 	ret = ieee80211_link_use_channel(&sdata->deflink, &chanreq,
 					 IEEE80211_CHANCTX_SHARED);
-	if (ret)
+	if (ret) {
+		memset(&sdata->vif.bss_conf.chanreq, 0,
+		       sizeof(sdata->vif.bss_conf.chanreq));
 		return ret;
+	}
 done:
 	local->monitor_chanreq = chanreq;
 	return 0;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 63a371c79183..79739b142398 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -758,6 +758,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
 			break;
 
 		ieee80211_link_release_channel(&sdata->deflink);
+		memset(&sdata->vif.bss_conf.chanreq, 0,
+		       sizeof(sdata->vif.bss_conf.chanreq));
 		fallthrough;
 	default:
 		if (!going_down)
-- 
2.47.3


             reply	other threads:[~2026-11-10 18:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 18:54 Felix Fietkau [this message]
2026-11-10 18:54 ` [PATCH wireless v2 2/4] wifi: mac80211: release monitor channels on suspend Felix Fietkau
2026-11-23  5:35   ` Devin Wittmayer
2026-11-10 18:54 ` [PATCH wireless v2 3/4] wifi: mac80211: remove real monitors from the driver " Felix Fietkau
2026-11-23  5:36   ` Devin Wittmayer
2026-11-10 18:54 ` [PATCH wireless v2 4/4] wifi: mac80211: reject a monitor channel without a running interface Felix Fietkau
2026-11-23  5:36   ` Devin Wittmayer
2026-11-23  5:35 ` [PATCH wireless v2 1/4] wifi: mac80211: keep the monitor chanreq empty without a channel Devin Wittmayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261110185436.2015505-1-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox