From: Ilan Peer <ilan.peer@xxxxxxxxx> 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 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@xxxxxxxxx> Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@xxxxxxxxx> Signed-off-by: Benjamin Berg <benjamin.berg@xxxxxxxxx> --- src/drivers/driver_nl80211_scan.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c index da90b55553..06e1e7058b 100644 --- a/src/drivers/driver_nl80211_scan.c +++ b/src/drivers/driver_nl80211_scan.c @@ -458,19 +458,28 @@ 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) || + if (wpa_driver_nl80211_set_mode(bss, + NL80211_IFTYPE_STATION) || wpa_driver_nl80211_scan(bss, params)) { nl80211_restore_ap_mode(bss); goto fail; } ret = 0; - } else + } else { goto fail; + } } drv->scan_state = SCAN_REQUESTED; -- 2.50.0 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap