aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2010-03-15 13:37:09 -0700
committerDmitry Shmidt <dimitrysh@google.com>2010-03-15 13:37:09 -0700
commit6eb6225dda14c6eaf34fcb3498e17d28060e1e16 (patch)
tree3edbd7dce42e9c0f946cb3bde004512bf1513deb
parent7ff87a18dd2d4fcccd4b2a77a8260688fd3a879f (diff)
downloadwpa_supplicant-6eb6225dda14c6eaf34fcb3498e17d28060e1e16.tar.gz
Restrict external scan requests during association stage
Change-Id: I159d7288bf8c78342394a65acf3e7086b0761b84 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--ctrl_iface.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/ctrl_iface.c b/ctrl_iface.c
index c9d4f07..0a694ad 100644
--- a/ctrl_iface.c
+++ b/ctrl_iface.c
@@ -1132,6 +1132,11 @@ static int wpa_supplicant_ctrl_iface_ap_scan(
if (ap_scan < 0 || ap_scan > 2)
return -1;
+#ifdef ANDROID
+ if ((ap_scan == 2) && (wpa_s->wpa_state != WPA_COMPLETED)) {
+ return -1;
+ }
+#endif
wpa_s->conf->ap_scan = ap_scan;
return 0;
}
@@ -1258,12 +1263,17 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
wpa_s->disconnected = 1;
wpa_supplicant_disassociate(wpa_s, REASON_DEAUTH_LEAVING);
} else if (os_strcmp(buf, "SCAN") == 0) {
- if (!wpa_s->scan_ongoing) {
+#ifdef ANDROID
+ if (!wpa_s->scan_ongoing && ((wpa_s->wpa_state <= WPA_SCANNING) ||
+ (wpa_s->wpa_state >= WPA_COMPLETED))) {
+#endif
wpa_s->scan_req = 2;
wpa_supplicant_req_scan(wpa_s, 0, 0);
- }
- else
+#ifdef ANDROID
+ } else {
wpa_printf(MSG_DEBUG, "Ongoing Scan action...");
+ }
+#endif
} else if (os_strcmp(buf, "SCAN_RESULTS") == 0) {
reply_len = wpa_supplicant_ctrl_iface_scan_results(
wpa_s, reply, reply_size);