]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Extend ROAM command to handle multiple SSIDs per BSS
authorJouni Malinen <j@w1.fi>
Sat, 30 Mar 2013 09:49:05 +0000 (11:49 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 30 Mar 2013 09:49:05 +0000 (11:49 +0200)
Select the BSS entry based on BSSID,SSID pairs instead of just BSSID to
avoid selecting an unexpected SSID for the ROAM command.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/ctrl_iface.c

index 5bcf748da5176b119af9f53d02e427a1e4e4efaf..3f1111b45fac82f1ebb1887f5cd8d697daa24c54 100644 (file)
@@ -3513,7 +3513,13 @@ static int wpa_supplicant_ctrl_iface_roam(struct wpa_supplicant *wpa_s,
 
        wpa_printf(MSG_DEBUG, "CTRL_IFACE ROAM " MACSTR, MAC2STR(bssid));
 
-       bss = wpa_bss_get_bssid(wpa_s, bssid);
+       if (!ssid) {
+               wpa_printf(MSG_DEBUG, "CTRL_IFACE ROAM: No network "
+                          "configuration known for the target AP");
+               return -1;
+       }
+
+       bss = wpa_bss_get(wpa_s, bssid, ssid->ssid, ssid->ssid_len);
        if (!bss) {
                wpa_printf(MSG_DEBUG, "CTRL_IFACE ROAM: Target AP not found "
                           "from BSS table");
@@ -3525,12 +3531,6 @@ static int wpa_supplicant_ctrl_iface_roam(struct wpa_supplicant *wpa_s,
         * allow roaming to other networks
         */
 
-       if (!ssid) {
-               wpa_printf(MSG_DEBUG, "CTRL_IFACE ROAM: No network "
-                          "configuration known for the target AP");
-               return -1;
-       }
-
        wpa_s->reassociate = 1;
        wpa_supplicant_connect(wpa_s, bss, ssid);