[PATCH 2/9] nl80211: Support scanning as AP
Johannes Berg
johannes at sipsolutions.net
Sat Oct 4 01:00:03 PDT 2025
On Fri, 2025-10-03 at 13:35 +0300, Jouni Malinen wrote:
> On Fri, Jul 18, 2025 at 01:00:58PM +0200, Benjamin Berg wrote:
> > If the kernel indicated support for scanning on AP interface,
> > set NL80211_SCAN_FLAG_AP in the scan request.
>
> > diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
> > @@ -267,7 +267,8 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd,
> > - if (!drv->hostapd && is_ap_interface(drv->nlmode)) {
> > + if (drv->support_ap_scan ||
> > + (!drv->hostapd && is_ap_interface(drv->nlmode))) {
> > wpa_printf(MSG_DEBUG, "nl80211: Add NL80211_SCAN_FLAG_AP");
> > scan_flags |= NL80211_SCAN_FLAG_AP;
> > }
>
> Why would this be done for all scan requests regardless of whether the
> interface is in AP mode? That scan is documented to be dangerous and to
> be used only when really needed..
It's harmless when in non-AP mode, since the only thing it does is say
"yes I'm requesting AP mode be disturbed by the scan" (i.e. allowed to
be leaving the channel even though there's no NoA etc.)
Still don't think it's necessarily the right thing to add
unconditionally, i.e. without user request, but it's kind of the other
way around.
Honestly, if wpa_s is just going to set the flag unconditionally then we
might as well _remove_ the flag entirely in the kernel since every scan
is going to disturb the AP anyway.
johannes
More information about the Hostap
mailing list