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

Message ID 20180614090043.27375-3-alfonso.sanchez-beato@canonical.com
State New
Headers show
Series
  • Do not de-authenticate if WoWLAN is enabled
Related show

Commit Message

Alfonso Sánchez-Beato June 14, 2018, 9 a.m.
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@canonical.com>
---
 wpa_supplicant/wpa_supplicant.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

Patch

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);