]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Support fixing the BSSID in IBSS mode
authorNicolas Cavallari <Nicolas.Cavallari@lri.fr>
Sat, 28 Jan 2012 09:33:47 +0000 (11:33 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 28 Jan 2012 09:33:47 +0000 (11:33 +0200)
When the "bssid=" option is set for an IBSS network and ap_scan = 2,
ask the driver to fix this BSSID, if possible.

Previously, any "bssid=" option were ignored in IBSS mode when ap_scan=2.

Signed-hostap: Nicolas Cavallari <cavallar@lri.fr>

src/drivers/driver.h
wpa_supplicant/wpa_supplicant.c

index d72c83b69f161bb14f390456b2b58b3f724d9e1b..f56c41b91b3190c8bbde0ea085b3aacb8d055991 100644 (file)
@@ -516,6 +516,13 @@ struct wpa_driver_associate_params {
         * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
         */
        int uapsd;
+
+       /**
+        * fixed_bssid - Whether to force this BSSID in IBSS mode
+        * 1 = Fix this BSSID and prevent merges.
+        * 0 = Do not fix BSSID.
+        */
+       int fixed_bssid;
 };
 
 enum hide_ssid {
index 68b80b95b68c2b628b5b5e92d40722c1c7320cbe..e79011ff3b7984ab7bf73d6547b4b989cbb496b2 100644 (file)
@@ -1364,6 +1364,13 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
                params.ssid = ssid->ssid;
                params.ssid_len = ssid->ssid_len;
        }
+
+       if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set &&
+           wpa_s->conf->ap_scan == 2) {
+               params.bssid = ssid->bssid;
+               params.fixed_bssid = 1;
+       }
+
        if (ssid->mode == WPAS_MODE_IBSS && ssid->frequency > 0 &&
            params.freq == 0)
                params.freq = ssid->frequency; /* Initial channel for IBSS */