From 5b12a055908ba07a57c7805d412fa7e69ab8b108 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 8 Nov 2023 11:56:03 +0200 Subject: [PATCH] Use SSID from driver when finding the current BSS entry The local network profile may not have matching SSID (it could be either the wildcard 0-length SSID or visible SSID in case of OWE transition mode), so check whether an exact match with a BSS entry can be made using the current SSID information from the driver (i.e., the SSID of the current association) when picking the BSS entry to use as the current one for an association. Signed-off-by: Jouni Malinen --- wpa_supplicant/events.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 1f186eb67..ff9b5b50b 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -144,8 +144,13 @@ static struct wpa_bss * wpa_supplicant_get_new_bss( { struct wpa_bss *bss = NULL; struct wpa_ssid *ssid = wpa_s->current_ssid; + u8 drv_ssid[SSID_MAX_LEN]; + int res; - if (ssid && ssid->ssid_len > 0) + res = wpa_drv_get_ssid(wpa_s, drv_ssid); + if (res > 0) + bss = wpa_bss_get(wpa_s, bssid, drv_ssid, res); + if (!bss && ssid && ssid->ssid_len > 0) bss = wpa_bss_get(wpa_s, bssid, ssid->ssid, ssid->ssid_len); if (!bss) bss = wpa_bss_get_bssid(wpa_s, bssid); -- 2.47.2