[RFC PATCH 2/2] wpa_supplicant: do not de-authenticate if WoWLAN is enabled

Alfonso Sánchez-Beato alfonso.sanchez-beato at canonical.com
Thu Jun 14 02:00:43 PDT 2018


Do not de-authenticate when WoWLAN is enabled, so we can boot the
system with WoWLAN after S5 (poweroff).

Signed-off-by: Alfonso Sanchez-Beato <alfonso.sanchez-beato at canonical.com>
---
 wpa_supplicant/wpa_supplicant.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 185a8d50f..0744bb8f7 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -5707,11 +5707,19 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s,
 
 	wpa_s->disconnected = 1;
 	if (wpa_s->drv_priv) {
-		wpa_supplicant_deauthenticate(wpa_s,
-					      WLAN_REASON_DEAUTH_LEAVING);
-
-		wpa_drv_set_countermeasures(wpa_s, 0);
-		wpa_clear_keys(wpa_s, NULL);
+		/* Don't deauthenticate if WoWLAN is enabled */
+		if (!wpa_s->driver->get_wowlan ||
+		    (wpa_s->driver->get_wowlan &&
+ 		    !wpa_s->driver->get_wowlan(wpa_s->drv_priv))) {
+			wpa_supplicant_deauthenticate(wpa_s,
+						      WLAN_REASON_DEAUTH_LEAVING);
+
+			wpa_drv_set_countermeasures(wpa_s, 0);
+			wpa_clear_keys(wpa_s, NULL);
+		} else {
+			wpa_dbg(wpa_s, MSG_INFO,
+				"No deauthentication; WoWLAN enabled.");
+		}
 	}
 
 	wpa_supplicant_cleanup(wpa_s);
-- 
2.17.1




More information about the Hostap mailing list