[PATCH] wpa_supplicant: Should disconnect on deinit whatever WOWLAN is enable or disable

xing.wan at mediatek.com xing.wan at mediatek.com
Mon Nov 23 02:26:46 EST 2020

From: xing wan <xing.wan at mediatek.com>

[wpa_supplicant] Rollback change list:02c21c02d09fdce55c0048cc58ff870cab77c9e9


    The function wpa_drv_get_wowlan() is to get signal of whether wowlan is triggered by wpa itself to kernel through wpa_drv_wowlan() function. Trigger action depends on the flag<wowlan_triggers = xx> in wpa_supp.conf.

    It must need to disconnect on interface deinit whatever WOWLAN is enable or disable, because deinit means that interface is removed or wpa_supplicant process killed.
    If don't do so, the status between kernel/wifi driver and wpa_supplicant will be different and it will occur wifi unexpected behavior.
            when supplicant re-started up, the status of supplicant is disconnected while kernel and wifi driver is connected because  wifi don't accept any disconnected or deauth signal before.
            And then, it could't scan any aps with <NL_SCAN_FLAGE_RANDOM_ADDR> scan cmd since kernel thinks wifi is already connected and block this scan flag.

Change-Id: Ib8944da4e8a77d4501778e7bcdca2540f2533d87
Signed-off-by: xing wan <xing.wan at mediatek.com>
Signed-off-by: zhao chen <zhao.chen at mediatek.com>
 wpa_supplicant/wpa_supplicant.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 0448958f..1fbb1044 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -6512,17 +6512,11 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s,
 	wpa_s->disconnected = 1;
 	if (wpa_s->drv_priv) {
-		/* Don't deauthenticate if WoWLAN is enabled */
-		if (!wpa_drv_get_wowlan(wpa_s)) {
-			wpa_supplicant_deauthenticate(
+		wpa_supplicant_deauthenticate(
-			wpa_drv_set_countermeasures(wpa_s, 0);
-			wpa_clear_keys(wpa_s, NULL);
-		} else {
-			wpa_msg(wpa_s, MSG_INFO,
-				"Do not deauthenticate as part of interface deinit since WoWLAN is enabled");
-		}
+		wpa_drv_set_countermeasures(wpa_s, 0);
+		wpa_clear_keys(wpa_s, NULL);

More information about the Hostap mailing list