path: root/wpa_supplicant/sme.c
diff options
authorIlan Peer <ilan.peer@intel.com>2014-03-27 06:58:33 (GMT)
committerJouni Malinen <j@w1.fi>2014-03-27 14:45:25 (GMT)
commitf1c4dbf5cd2250e1e198c174eb0475d38b6b8aef (patch)
tree3c76f3abffa247b5ed1a50c90412c643b87b3ce1 /wpa_supplicant/sme.c
parent4f560cdee34e0689a698b38beaeae3d48dadd913 (diff)
wpa_supplicant: Remove pending sme-connect radio work
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>
Diffstat (limited to 'wpa_supplicant/sme.c')
1 files changed, 8 insertions, 2 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index a860afb..2538ba0 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -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));