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>
/*
* 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) ||