aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_supplicant.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2008-06-04 18:00:09 (GMT)
committerJouni Malinen <j@w1.fi>2008-06-04 18:00:09 (GMT)
commit1d3c75b3b6663ed9f3a9a8dea8d47056cce2680f (patch)
tree2a88f77862ef82861310cbcb4f8fc4f93cc0dd4f /wpa_supplicant/wpa_supplicant.c
parent59c9707863336c1255936c755d24c8eb1ed8db2f (diff)
downloadhostap-06-1d3c75b3b6663ed9f3a9a8dea8d47056cce2680f.zip
hostap-06-1d3c75b3b6663ed9f3a9a8dea8d47056cce2680f.tar.gz
hostap-06-1d3c75b3b6663ed9f3a9a8dea8d47056cce2680f.tar.bz2
Give adhoc associations a bit more time
Depending on how the driver implements IBSS searching and creation, it may need to perform one or more scans before successfully completing the association operation. Therefore, increase the timeout for IBSS association operations so that the supplicant doesn't interrupt the driver as much.
Diffstat (limited to 'wpa_supplicant/wpa_supplicant.c')
-rw-r--r--wpa_supplicant/wpa_supplicant.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 5487212..5fb4f16 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1090,13 +1090,15 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
} else {
/* Timeout for IEEE 802.11 authentication and association */
- int timeout;
- if (assoc_failed)
- timeout = 5;
- else if (wpa_s->conf->ap_scan == 1)
- timeout = 10;
- else
- timeout = 60;
+ int timeout = 60;
+
+ if (assoc_failed) {
+ /* give IBSS a bit more time */
+ timeout = ssid->mode ? 10 : 5;
+ } else if (wpa_s->conf->ap_scan == 1) {
+ /* give IBSS a bit more time */
+ timeout = ssid->mode ? 20 : 10;
+ }
wpa_supplicant_req_auth_timeout(wpa_s, timeout, 0);
}