]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Remove pending sme-connect radio work
authorIlan Peer <ilan.peer@intel.com>
Thu, 27 Mar 2014 06:58:33 +0000 (08:58 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 27 Mar 2014 14:45:25 +0000 (16:45 +0200)
If a new connection is attempted while there is a pending sme-connection
radio work, cancel the pending radio work and continue with the new
connection attempt. This is preferable over rejecting the new work and
continuing with the pending one, as it is possible that the previous
work is no longer valid.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
wpa_supplicant/sme.c

index a860afb86bf7d4a6507991aec55da89ebad1bbb7..2538ba0ced85c804f65bb8e8d3902f8f8b2d8581 100644 (file)
@@ -477,8 +477,14 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
        }
 
        if (radio_work_pending(wpa_s, "sme-connect")) {
-               wpa_dbg(wpa_s, MSG_DEBUG, "SME: Reject sme_authenticate() call since pending work exist");
-               return;
+               /*
+                * The previous sme-connect work might no longer be valid due to
+                * the fact that the BSS list was updated. In addition, it makes
+                * sense to adhere to the 'newer' decision.
+                */
+               wpa_dbg(wpa_s, MSG_DEBUG,
+                       "SME: Remove previous pending sme-connect");
+               radio_remove_works(wpa_s, "sme-connect", 0);
        }
 
        cwork = os_zalloc(sizeof(*cwork));