]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Give adhoc associations a bit more time
authorDan Williams <dcbw@redhat.com>
Wed, 4 Jun 2008 18:00:09 +0000 (21:00 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 4 Jun 2008 18:00:09 +0000 (21:00 +0300)
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.

wpa_supplicant/wpa_supplicant.c

index 548721292e91a98a9042576a79c6bca3727d88d7..5fb4f16f3c30d1aa02e99a8de1b4161ed7cc3630 100644 (file)
@@ -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);
        }