aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/scan.c
diff options
context:
space:
mode:
authorShaul Triebitz <shaul.triebitz@intel.com>2017-03-28 12:26:38 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-29 12:03:16 (GMT)
commit3d5f0e916d1dcc5befa819f4e16773a2ec6f95d3 (patch)
treea41df96eb02f898a014164e381c01fda8d8513de /wpa_supplicant/scan.c
parent0a503e0de2e930cbb70bf875b50a6bce37d32f35 (diff)
downloadhostap-3d5f0e916d1dcc5befa819f4e16773a2ec6f95d3.zip
hostap-3d5f0e916d1dcc5befa819f4e16773a2ec6f95d3.tar.gz
hostap-3d5f0e916d1dcc5befa819f4e16773a2ec6f95d3.tar.bz2
wpa_supplicant: Avoid associating to temp disabled SSID in ap_scan=2
In ap_scan=2 mode, wpa_supplicant_assoc_try() did not check whether the SSID is temporarily disabled before trying to associate and this may result in an infinite connect/disconnect loop. If the association succeeds while the SSID is temporarily disabled, wpa_supplicant will request to deauthenticate and that in turn will cause the SSID to be temporarily disabled again. Fix that by postponing the association until the SSID is no longer temporarily disabled. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Diffstat (limited to 'wpa_supplicant/scan.c')
-rw-r--r--wpa_supplicant/scan.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 413abf6..85b732f 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -117,9 +117,19 @@ int wpa_supplicant_enabled_networks(struct wpa_supplicant *wpa_s)
static void wpa_supplicant_assoc_try(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid)
{
+ int min_temp_disabled = 0;
+
while (ssid) {
- if (!wpas_network_disabled(wpa_s, ssid))
- break;
+ if (!wpas_network_disabled(wpa_s, ssid)) {
+ int temp_disabled = wpas_temp_disabled(wpa_s, ssid);
+
+ if (temp_disabled <= 0)
+ break;
+
+ if (!min_temp_disabled ||
+ temp_disabled < min_temp_disabled)
+ min_temp_disabled = temp_disabled;
+ }
ssid = ssid->next;
}
@@ -128,7 +138,7 @@ static void wpa_supplicant_assoc_try(struct wpa_supplicant *wpa_s,
wpa_dbg(wpa_s, MSG_DEBUG, "wpa_supplicant_assoc_try: Reached "
"end of scan list - go back to beginning");
wpa_s->prev_scan_ssid = WILDCARD_SSID_SCAN;
- wpa_supplicant_req_scan(wpa_s, 0, 0);
+ wpa_supplicant_req_scan(wpa_s, min_temp_disabled, 0);
return;
}
if (ssid->next) {