aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-06-11 20:50:13 (GMT)
committerJouni Malinen <j@w1.fi>2010-06-11 20:50:13 (GMT)
commit41e650ae5c90a83a0c22989d43527901347dacc0 (patch)
tree7e9ce9c191e6047b0de452a32cd73aef47f73988 /wpa_supplicant/wps_supplicant.c
parentf62c2315f71860d7334c8dcd470c702a20d8392b (diff)
downloadhostap-41e650ae5c90a83a0c22989d43527901347dacc0.zip
hostap-41e650ae5c90a83a0c22989d43527901347dacc0.tar.gz
hostap-41e650ae5c90a83a0c22989d43527901347dacc0.tar.bz2
WPS: Use different scan result sorting rules when doing WPS provisioning
The AP configuration may change after provisioning, so it is better not to use the current security policy to prioritize results. Instead, use WPS Selected Registrar attribute as the main sorting key and use signal strength next without considering security policy or rate sets. The non-WPS provisioning case remains as-is, i.e., this change applies only when trying to find an AP for WPS provisioning.
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 2b90e57..db615f6 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1264,3 +1264,16 @@ int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s)
#endif /* CONFIG_WPS_ER */
return 0;
}
+
+
+int wpas_wps_in_progress(struct wpa_supplicant *wpa_s)
+{
+ struct wpa_ssid *ssid;
+
+ for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next) {
+ if (!ssid->disabled && ssid->key_mgmt == WPA_KEY_MGMT_WPS)
+ return 1;
+ }
+
+ return 0;
+}