aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-12-20 20:55:02 (GMT)
committerJouni Malinen <j@w1.fi>2008-12-20 20:55:02 (GMT)
commit24c23d1b3c3c4e04a7039cd721b3cd12f5af98e9 (patch)
treefb584091301bf6d014130626cc56f6e2c4cf3f66 /wpa_supplicant/wpa_supplicant.c
parent3c1e276507a3c0c8c489afb3ee1fe9bd8f7c0e31 (diff)
downloadhostap-06-24c23d1b3c3c4e04a7039cd721b3cd12f5af98e9.zip
hostap-06-24c23d1b3c3c4e04a7039cd721b3cd12f5af98e9.tar.gz
hostap-06-24c23d1b3c3c4e04a7039cd721b3cd12f5af98e9.tar.bz2
WPS: Added support for wildcard SSID matching in ap_scan=2 mode
Change association behavior to match with ap_scan=1 when WPS is used in ap_scan=2 mode with wildcard SSID matching. In addition, allow hardcoded BSSID to be used to select AP even if selected registrar attribute is not present.
Diffstat (limited to 'wpa_supplicant/wpa_supplicant.c')
-rw-r--r--wpa_supplicant/wpa_supplicant.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index cbe466c..6701f84 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -935,6 +935,17 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
wpa_ft_prepare_auth_request(wpa_s->wpa);
}
#endif /* CONFIG_IEEE80211R */
+#ifdef CONFIG_WPS
+ } else if ((ssid->ssid == NULL || ssid->ssid_len == 0) &&
+ wpa_s->conf->ap_scan == 2 &&
+ (ssid->key_mgmt & WPA_KEY_MGMT_WPS)) {
+ /* Use ap_scan==1 style network selection to find the network
+ */
+ wpa_s->scan_req = 2;
+ wpa_s->reassociate = 1;
+ wpa_supplicant_req_scan(wpa_s, 0, 0);
+ return;
+#endif /* CONFIG_WPS */
} else {
wpa_msg(wpa_s, MSG_INFO, "Trying to associate with SSID '%s'",
wpa_ssid_txt(ssid->ssid, ssid->ssid_len));
@@ -1418,6 +1429,14 @@ struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s)
(!entry->bssid_set ||
os_memcmp(bssid, entry->bssid, ETH_ALEN) == 0))
return entry;
+#ifdef CONFIG_WPS
+ if (!entry->disabled &&
+ (entry->key_mgmt & WPA_KEY_MGMT_WPS) &&
+ (entry->ssid == NULL || entry->ssid_len == 0) &&
+ (!entry->bssid_set ||
+ os_memcmp(bssid, entry->bssid, ETH_ALEN) == 0))
+ return entry;
+#endif /* CONFIG_WPS */
entry = entry->next;
}