]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix BSSID enforcement with driver-based BSS selection
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 11 May 2012 12:27:46 +0000 (15:27 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 11 May 2012 12:27:46 +0000 (15:27 +0300)
Previously, wpa_supplicant did not specify BSSID to any connection
request if the driver indicated that it will take care of BSS selection.
This is fine for most use cases, but can result to issues if the network
block has an explicit bssid parameter to select which BSS is to be used.
Fix this by setting BSSID and channel when the network block includes the
bssid parameter even if the driver indicates support for BSS selection.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
intended-for: hostap-1

wpa_supplicant/wpa_supplicant.c

index 5b9b55674f9b0962a80fb251278a8744058f131c..09b164022afcfee5a9c37b266c7ec4026fd1a854 100644 (file)
@@ -1347,7 +1347,12 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
        if (bss) {
                params.ssid = bss->ssid;
                params.ssid_len = bss->ssid_len;
-               if (!wpas_driver_bss_selection(wpa_s)) {
+               if (!wpas_driver_bss_selection(wpa_s) || ssid->bssid_set) {
+                       wpa_printf(MSG_DEBUG, "Limit connection to BSSID "
+                                  MACSTR " freq=%u MHz based on scan results "
+                                  "(bssid_set=%d)",
+                                  MAC2STR(bss->bssid), bss->freq,
+                                  ssid->bssid_set);
                        params.bssid = bss->bssid;
                        params.freq = bss->freq;
                }