Patchwork Prohibit pno start during assoc process and in connect state

login
register
mail settings
Submitter Dmitry Shmidt
Date Nov. 6, 2013, 2:08 a.m.
Message ID <20131106021200.E3EFD13FAD3@ushik.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/288705/
State Accepted
Headers show

Comments

Dmitry Shmidt - Nov. 6, 2013, 2:08 a.m.
Change-Id: I58bc138d5b74b1b62f7a9612c12399083aef1374
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
---
 wpa_supplicant/ctrl_iface.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 9f3fe42..992fd7f 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -58,6 +58,12 @@  static int pno_start(struct wpa_supplicant *wpa_s)
 	if (wpa_s->pno)
 		return 0;
 
+	if ((wpa_s->wpa_state > WPA_SCANNING) &&
+	    (wpa_s->wpa_state <= WPA_COMPLETED)) {
+		wpa_printf(MSG_ERROR, "PNO: In assoc process");
+		return -EAGAIN;
+	}
+
 	if (wpa_s->wpa_state == WPA_SCANNING) {
 		wpa_supplicant_cancel_sched_scan(wpa_s);
 		wpa_supplicant_cancel_scan(wpa_s);