]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Prevent ap_scan change during association
authorDmitry Shmidt <dimitrysh@google.com>
Tue, 16 Aug 2011 18:52:06 +0000 (11:52 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 21 Oct 2011 16:00:18 +0000 (19:00 +0300)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
wpa_supplicant/wpa_supplicant.c

index a778f3aa09743e740885fb101806b172d8c7969a..91aeb2d79b3e9c21b9d2358850a54d1da608c01f 100644 (file)
@@ -1712,6 +1712,16 @@ int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s, int ap_scan)
        if (ap_scan < 0 || ap_scan > 2)
                return -1;
 
+#ifdef ANDROID
+       if (ap_scan == 2 && ap_scan != wpa_s->conf->ap_scan &&
+           wpa_s->wpa_state >= WPA_ASSOCIATING &&
+           wpa_s->wpa_state < WPA_COMPLETED) {
+               wpa_printf(MSG_ERROR, "ap_scan = %d (%d) rejected while "
+                          "associating", wpa_s->conf->ap_scan, ap_scan);
+               return 0;
+       }
+#endif /* ANDROID */
+
        old_ap_scan = wpa_s->conf->ap_scan;
        wpa_s->conf->ap_scan = ap_scan;