Prevent ap_scan change during association

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
Dmitry Shmidt 2011-08-16 11:52:06 -07:00 committed by Jouni Malinen
parent 8f5b9aa19a
commit 48f8e03622

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