aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-12-28 14:07:15 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-09 19:04:25 (GMT)
commitd9400277a2612b8a016d23e6927560842d1e1615 (patch)
tree37d996951a8b2ee9f580928f13228d958c48f21e
parente49ecb1229d8a0c194aa79f173b0cef59416d83c (diff)
downloadhostap-06-d9400277a2612b8a016d23e6927560842d1e1615.zip
hostap-06-d9400277a2612b8a016d23e6927560842d1e1615.tar.gz
hostap-06-d9400277a2612b8a016d23e6927560842d1e1615.tar.bz2
WPS: Clear SSID selection if more than one BSSID match is found
Need to use wildcard SSID matching for WPS connection if the same BSSID occurs multiple time in scan results since any of the SSIDs may be used. (cherry picked from commit f7e54365022cd30de16e32d4a88e085861243881)
-rw-r--r--wpa_supplicant/wps_supplicant.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index ed5ce9a..9422b1b 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -29,6 +29,7 @@
#include "wpa.h"
#include "wps_supplicant.h"
+
#define WPS_PIN_SCAN_IGNORE_SEL_REG 3
static void wpas_wps_timeout(void *eloop_ctx, void *timeout_ctx);
@@ -488,7 +489,7 @@ static struct wpa_ssid * wpas_wps_add_network(struct wpa_supplicant *wpa_s,
if (bssid) {
size_t i;
- struct wpa_scan_res *res;
+ int count = 0;
os_memcpy(ssid->bssid, bssid, ETH_ALEN);
ssid->bssid_set = 1;
@@ -500,6 +501,7 @@ static struct wpa_ssid * wpas_wps_add_network(struct wpa_supplicant *wpa_s,
for (i = 0; i < wpa_s->scan_res->num; i++) {
const u8 *ie;
+ struct wpa_scan_res *res;
res = wpa_s->scan_res->res[i];
if (os_memcmp(bssid, res->bssid, ETH_ALEN) != 0)
@@ -514,7 +516,18 @@ static struct wpa_ssid * wpas_wps_add_network(struct wpa_supplicant *wpa_s,
break;
os_memcpy(ssid->ssid, ie + 2, ie[1]);
ssid->ssid_len = ie[1];
- break;
+ wpa_hexdump_ascii(MSG_DEBUG, "WPS: Picked SSID from "
+ "scan results",
+ ssid->ssid, ssid->ssid_len);
+ count++;
+ }
+
+ if (count > 1) {
+ wpa_printf(MSG_DEBUG, "WPS: More than one SSID found "
+ "for the AP; use wildcard");
+ os_free(ssid->ssid);
+ ssid->ssid = NULL;
+ ssid->ssid_len = 0;
}
}