diff options
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r-- | wpa_supplicant/events.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index c3e9ed6..e97939e 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -473,7 +473,7 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s, return 0; } - if (!wpa_key_mgmt_wpa(ssid->key_mgmt)) { + if (!wpa_key_mgmt_wpa(ssid->key_mgmt) && !rsn_ie && !wpa_ie) { wpa_dbg(wpa_s, MSG_DEBUG, " allow in non-WPA/WPA2"); return 1; } @@ -1219,7 +1219,8 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, if (wpas_p2p_scan_no_go_seen(wpa_s) == 1) return 0; - if (wpa_s->p2p_in_provisioning) { + if (wpa_s->p2p_in_provisioning || + wpa_s->show_group_started) { /* * Use shorter wait during P2P Provisioning * state to speed up group formation. @@ -1231,9 +1232,20 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, return 0; } #endif /* CONFIG_P2P */ - if ((data && data->scan_info.is_sched_scan_res) || - !wpa_s->sched_scanning) + /* + * If sched scan results were received but we didn't + * connect then there's an AP with a matching SSID + * which may have mismatching security. Don't restart + * another sched scan immediately and wait for the next + * normal scan in scan_interval to trigger it in order + * to avoid a sched scan results storm. + * In any case if it's not started kick start it. + */ + if (!wpa_s->sched_scanning) wpa_supplicant_req_sched_scan(wpa_s); + else if (data && data->scan_info.is_sched_scan_res) + wpa_supplicant_cancel_sched_scan(wpa_s); + wpa_supplicant_req_new_scan(wpa_s, timeout_sec, timeout_usec); } @@ -2835,6 +2847,13 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, #ifdef CONFIG_P2P wpas_p2p_update_channel_list(wpa_s); #endif /* CONFIG_P2P */ + + /* Restart the sched scan with updated channel list */ + if (wpa_s->sched_scanning) { + wpa_dbg(wpa_s, MSG_DEBUG, "Channel list changed restart" + " sched scan."); + wpa_supplicant_req_sched_scan(wpa_s); + } break; case EVENT_INTERFACE_UNAVAILABLE: #ifdef CONFIG_P2P |