From c9f10903800b573db0d06aabdea28bce1c7c6976 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 8 Apr 2015 15:07:02 -0500 Subject: [PATCH] wiphy: If connection failed, reset the PSK This allows us to retry the agent for the correct passphrase --- src/wiphy.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wiphy.c b/src/wiphy.c index 9fb39192..eadcbcce 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -1228,6 +1228,15 @@ static void mlme_disconnect_event(struct l_genl_msg *msg, dbus_pending_reply(&netdev->connect_pending, dbus_error_failed(netdev->connect_pending)); + + /* + * Connection failed, if PSK try asking for the passphrase + * once more + */ + if (network->ssid_security == SCAN_SSID_SECURITY_PSK) { + l_free(network->psk); + network->psk = NULL; + } } netdev->connected_bss = NULL;