Skip to content

Commit

Permalink
gsupplicant: Rely on wpa_supplicant retry mechanism
Browse files Browse the repository at this point in the history
When connecting WiFi with a wrong passphrase, connman is longer than
it should to cancel the attempt.

The effect is this change, is to have a quicker feedback to the agent
in charge of passphrase input.

Since, Wpa_supplicant 2.0 and later is already managing its own retry
mechanism, let's use it because it's overkill to have this also
inside comman and even more if it add an unnecessary delay.

Note, that for earlier versions of wpa_supplicant this change may be
reverted, while for later ones (2.0 to HEAD/2013-12-10), it's
resulting a 10 secs improvement (observed the whole test is now 10s
vs 20s between two user's attempts).

Let me credit Liu Guoqiang and Tomasz Bursztyka for helping to solve
this problem.

Fixes CM-655
  • Loading branch information
rzr authored and pfl committed Jan 31, 2014
1 parent 9e59cc8 commit 289c7fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/wifi.c
Expand Up @@ -58,8 +58,7 @@

#define CLEANUP_TIMEOUT 8 /* in seconds */
#define INACTIVE_TIMEOUT 12 /* in seconds */
#define MAXIMUM_RETRIES 2
#define FAVORITE_MAXIMUM_RETRIES 4
#define FAVORITE_MAXIMUM_RETRIES 2

#define BGSCAN_DEFAULT "simple:30:-45:300"
#define AUTOSCAN_DEFAULT "exponential:3:300"
Expand Down Expand Up @@ -1581,8 +1580,7 @@ static bool handle_4way_handshake_failure(GSupplicantInterface *interface,
if (connman_service_get_favorite(service)) {
if (wifi->retries < FAVORITE_MAXIMUM_RETRIES)
return true;
} else if (wifi->retries < MAXIMUM_RETRIES)
return true;
}

wifi->retries = 0;
connman_network_set_error(network, CONNMAN_NETWORK_ERROR_INVALID_KEY);
Expand Down

0 comments on commit 289c7fc

Please sign in to comment.