From cbf41ca79646857733273d6edf6b583c9b0e2abe Mon Sep 17 00:00:00 2001 From: Sean Lin Date: Wed, 31 Jul 2013 23:09:34 +0300 Subject: [PATCH] P2P: Do not delay retries on failure during group formation 4-way handshake may fail under extremely noisy environment and if this happens during P2P group formation, the 10 second extra delay added in wpas_auth_failed() can result in running over the 15 second timeout. Avoid this by skipping the delay mechanism in wpas_auth_failed() for the P2P group formation case. The P2P formation timeout will take care of stopping the attempts if the failure condition does not get resolved. Signed-hostap: Jouni Malinen --- wpa_supplicant/wpa_supplicant.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index bcb5ae949..a18922a28 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -3804,6 +3804,18 @@ void wpas_auth_failed(struct wpa_supplicant *wpa_s) return; ssid->auth_failures++; + +#ifdef CONFIG_P2P + if (ssid->p2p_group && + (wpa_s->p2p_in_provisioning || wpa_s->show_group_started)) { + /* + * Skip the wait time since there is a short timeout on the + * connection to a P2P group. + */ + return; + } +#endif /* CONFIG_P2P */ + if (ssid->auth_failures > 50) dur = 300; else if (ssid->auth_failures > 20)