From: Ilan Peer Date: Fri, 18 Jul 2025 11:00:59 +0000 (+0200) Subject: nl80211: Don't try to scan on AP interface with active links X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7930eae3b1ceab5fce9c30a3e46c97f4c72938e;p=thirdparty%2Fhostap.git nl80211: Don't try to scan on AP interface with active links 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 Reviewed-by: Andrei Otcheretianski Signed-off-by: Benjamin Berg --- diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c index f0313c1af..6fa99f45b 100644 --- a/src/drivers/driver_nl80211_scan.c +++ b/src/drivers/driver_nl80211_scan.c @@ -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) ||