From: Matthew Schwartz <matthew.schwartz@linux.dev>
To: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: Clarification on the usage of NL80211_SCAN_FLAG_FLUSH
Date: Tue, 27 Jan 2026 11:40:15 -0800 [thread overview]
Message-ID: <3b3bdd35-b831-4274-8b91-7ab90f6d4eec@linux.dev> (raw)
Hello,
I had a quick question about the proper usage of NL80211_SCAN_FLAG_FLUSH. I'm looking into a bug while using iwd where rapidly switching between a 2.4GHz network and a 5GHz network can have spurious connection failures. After debugging the issue, it looks like iwd is flushing all BSS entries by using NL80211_SCAN_FLAG_FLUSH for both full scans and partial-channel scans (i.e. only 2.4GHz, only 5GHz), and if this happens during the network connection process it causes the failures.
The observed behavior is:
1. iwd issues a 2.4GHz-only quick scan with FLUSH
2. User initiates connection to a 5GHz BSS from a previous scan
3. Scan completes, kernel flushes all BSS entries
4. Connection fails because the target BSS is no longer in cache
Is this intended behavior of NL80211_SCAN_FLAG_FLUSH where it clears all BSS entries regardless of which channels were scanned, or should NL80211_SCAN_FLAG_FLUSH be limited to channels that were scanned in the request which triggered them? The uAPI definition for it is simply "flush cache before scanning", but this seems open to interpretation as to whether it means the entire cache or just the cache on scanned channels.
If this is working as designed then I will look at submitting a fix to iwd, but if limiting the flush during partial scans is a viable option I could look at fixing that on the kernel side.
Thanks,
Matt
next reply other threads:[~2026-01-27 19:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 19:40 Matthew Schwartz [this message]
2026-01-28 8:38 ` Clarification on the usage of NL80211_SCAN_FLAG_FLUSH Johannes Berg
2026-01-28 8:53 ` Matthew Schwartz
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=3b3bdd35-b831-4274-8b91-7ab90f6d4eec@linux.dev \
--to=matthew.schwartz@linux.dev \
--cc=johannes.berg@intel.com \
--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