Prevent ap_scan change during association
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
parent
8f5b9aa19a
commit
48f8e03622
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue