aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorKrishna Vamsi <vamsin@qti.qualcomm.com>2015-03-13 12:29:20 (GMT)
committerJouni Malinen <j@w1.fi>2015-03-24 19:13:28 (GMT)
commitc41d0840a1ae4d755c525b091a4bf9d740efdb5f (patch)
treeaeb851e7ec3d693e1249bb1145a8c3f7ecb6f116 /wpa_supplicant/events.c
parent05121d356418c71741e865aa7c6158723a76b804 (diff)
downloadhostap-c41d0840a1ae4d755c525b091a4bf9d740efdb5f.zip
hostap-c41d0840a1ae4d755c525b091a4bf9d740efdb5f.tar.gz
hostap-c41d0840a1ae4d755c525b091a4bf9d740efdb5f.tar.bz2
nl80211: Allow driver-based roam to change ESS
This extends NL80211_CMD_ROAM event processing to allow the driver to roam to another ESS (different SSID) when using offloaded BSS selection. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 3adb954..b10f583 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -158,11 +158,32 @@ static void wpa_supplicant_update_current_bss(struct wpa_supplicant *wpa_s)
static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
{
struct wpa_ssid *ssid, *old_ssid;
+ u8 drv_ssid[MAX_SSID_LEN];
+ size_t drv_ssid_len;
int res;
if (wpa_s->conf->ap_scan == 1 && wpa_s->current_ssid) {
wpa_supplicant_update_current_bss(wpa_s);
- return 0;
+
+ if (wpa_s->current_ssid->ssid_len == 0)
+ return 0; /* current profile still in use */
+ res = wpa_drv_get_ssid(wpa_s, drv_ssid);
+ if (res < 0) {
+ wpa_msg(wpa_s, MSG_INFO,
+ "Failed to read SSID from driver");
+ return 0; /* try to use current profile */
+ }
+ drv_ssid_len = res;
+
+ if (drv_ssid_len == wpa_s->current_ssid->ssid_len &&
+ os_memcmp(drv_ssid, wpa_s->current_ssid->ssid,
+ drv_ssid_len) == 0)
+ return 0; /* current profile still in use */
+
+ wpa_msg(wpa_s, MSG_DEBUG,
+ "Driver-initiated BSS selection changed the SSID to %s",
+ wpa_ssid_txt(drv_ssid, drv_ssid_len));
+ /* continue selecting a new network profile */
}
wpa_dbg(wpa_s, MSG_DEBUG, "Select network based on association "