From: Jouni Malinen Date: Fri, 15 Mar 2019 10:59:55 +0000 (+0200) Subject: Remove pending connect and sme-connect radio works on disconnect X-Git-Tag: hostap_2_8~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5db77504985653cfd40afea6c643d5071070787;p=thirdparty%2Fhostap.git Remove pending connect and sme-connect radio works on disconnect There was a race condition in a case where a new connection attempt was scheduled as a pending radio work and that was followed by a DISCONNECT command before the pending radio work is started. The pending radio work would not have been deleted in that sequence and instead, it was executed when the radio became available next. This could result in an unexpected connection after an explicit request to disconnect. Fix this by removing pending connect and sme-connect radio works on disconnection request. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 20ae588ad..0b269225f 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -7075,6 +7075,8 @@ void wpas_request_disconnection(struct wpa_supplicant *wpa_s) wpa_supplicant_cancel_scan(wpa_s); wpa_supplicant_deauthenticate(wpa_s, WLAN_REASON_DEAUTH_LEAVING); eloop_cancel_timeout(wpas_network_reenabled, wpa_s, NULL); + radio_remove_works(wpa_s, "connect", 0); + radio_remove_works(wpa_s, "sme-connect", 0); }