]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use the link BSSID to resolve current BSS for whether to roam check
authorBenjamin Berg <benjamin.berg@intel.com>
Wed, 13 Dec 2023 12:37:40 +0000 (14:37 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 16 Dec 2023 16:04:32 +0000 (18:04 +0200)
Otherwise any new scan result (even manual ones if they do not set
use_id=X to a non-zero value), can cause a reconnect to the same BSS
when MLO is used. This is because the current BSS is not detected by
wpa_supplicant_need_to_roam() and it assumes that roaming is needed.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
wpa_supplicant/events.c

index 4644f54888c98d4af79bce5c2b3bf141baf00a8d..dd988e7b37bd094e4866b8a1e9da32709b0e1a32 100644 (file)
@@ -2304,6 +2304,7 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
                                       struct wpa_ssid *ssid)
 {
        struct wpa_bss *current_bss = NULL;
+       const u8 *bssid;
 
        if (wpa_s->reassociate)
                return 1; /* explicit request to reassociate */
@@ -2317,12 +2318,17 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
        if (wpas_driver_bss_selection(wpa_s))
                return 0; /* Driver-based roaming */
 
+       if (wpa_s->valid_links)
+               bssid = wpa_s->links[wpa_s->mlo_assoc_link_id].bssid;
+       else
+               bssid = wpa_s->bssid;
+
        if (wpa_s->current_ssid->ssid)
-               current_bss = wpa_bss_get(wpa_s, wpa_s->bssid,
+               current_bss = wpa_bss_get(wpa_s, bssid,
                                          wpa_s->current_ssid->ssid,
                                          wpa_s->current_ssid->ssid_len);
        if (!current_bss)
-               current_bss = wpa_bss_get_bssid(wpa_s, wpa_s->bssid);
+               current_bss = wpa_bss_get_bssid(wpa_s, bssid);
 
        if (!current_bss)
                return 1; /* current BSS not seen in scan results */