]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Don't try to scan on AP interface with active links
authorIlan Peer <ilan.peer@intel.com>
Fri, 18 Jul 2025 11:00:59 +0000 (13:00 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 3 Oct 2025 10:38:21 +0000 (13:38 +0300)
When the kernel driver doesn't support scanning on an AP interface,
nl80211 drivers attempts to switch to station interface to perform a
scan. However, when the AP is affiliated with an AP MLD and there are
already active links this is not valid. In such a case, fail the scan.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
src/drivers/driver_nl80211_scan.c

index f0313c1af7250d81b112bb1ad4fa7a1002ca2fc6..6fa99f45b606dfe540f650313ad36f47e5fdfe48 100644 (file)
@@ -457,8 +457,16 @@ int wpa_driver_nl80211_scan(struct i802_bss *bss,
 
                        /*
                         * mac80211 does not allow scan requests in AP mode, so
-                        * try to do this in station mode.
+                        * try to do this in station mode. Do so only if there
+                        * are not active links in the AP MLD.
                         */
+                       wpa_printf(MSG_DEBUG,
+                                  "nl80211: AP scan failed on %s. Links=0x%x",
+                                  bss->ifname, bss->valid_links);
+
+                       if (bss->valid_links)
+                               goto fail;
+
                        drv->ap_scan_as_station = drv->nlmode;
                        if (wpa_driver_nl80211_set_mode(
                                    bss, NL80211_IFTYPE_STATION) ||