RSN: Update preauth scan results only based on new scan results
The fast-connect optimization to skip a new scan did not update how the RSN preauthentication callback is used. There is no point in trying to add preauthentication candidates from cases where scan was skipped, so skip this call, too, in such cases. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
18e00b5e4d
commit
06b7f58def
1 changed files with 12 additions and 7 deletions
|
@ -44,7 +44,8 @@
|
||||||
#include "interworking.h"
|
#include "interworking.h"
|
||||||
|
|
||||||
|
|
||||||
static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s);
|
static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
|
||||||
|
int new_scan);
|
||||||
|
|
||||||
|
|
||||||
static int wpas_temp_disabled(struct wpa_supplicant *wpa_s,
|
static int wpas_temp_disabled(struct wpa_supplicant *wpa_s,
|
||||||
|
@ -1211,11 +1212,12 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
|
||||||
|
|
||||||
wpa_scan_results_free(scan_res);
|
wpa_scan_results_free(scan_res);
|
||||||
|
|
||||||
return wpas_select_network_from_last_scan(wpa_s);
|
return wpas_select_network_from_last_scan(wpa_s, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s)
|
static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
|
||||||
|
int new_scan)
|
||||||
{
|
{
|
||||||
struct wpa_bss *selected;
|
struct wpa_bss *selected;
|
||||||
struct wpa_ssid *ssid = NULL;
|
struct wpa_ssid *ssid = NULL;
|
||||||
|
@ -1226,6 +1228,7 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s)
|
||||||
int skip;
|
int skip;
|
||||||
skip = !wpa_supplicant_need_to_roam(wpa_s, selected, ssid);
|
skip = !wpa_supplicant_need_to_roam(wpa_s, selected, ssid);
|
||||||
if (skip) {
|
if (skip) {
|
||||||
|
if (new_scan)
|
||||||
wpa_supplicant_rsn_preauth_scan_results(wpa_s);
|
wpa_supplicant_rsn_preauth_scan_results(wpa_s);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1234,6 +1237,7 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s)
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG, "Connect failed");
|
wpa_dbg(wpa_s, MSG_DEBUG, "Connect failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (new_scan)
|
||||||
wpa_supplicant_rsn_preauth_scan_results(wpa_s);
|
wpa_supplicant_rsn_preauth_scan_results(wpa_s);
|
||||||
/*
|
/*
|
||||||
* Do not notify other virtual radios of scan results since we do not
|
* Do not notify other virtual radios of scan results since we do not
|
||||||
|
@ -1246,6 +1250,7 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s)
|
||||||
if (ssid) {
|
if (ssid) {
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG, "Setup a new network");
|
wpa_dbg(wpa_s, MSG_DEBUG, "Setup a new network");
|
||||||
wpa_supplicant_associate(wpa_s, NULL, ssid);
|
wpa_supplicant_associate(wpa_s, NULL, ssid);
|
||||||
|
if (new_scan)
|
||||||
wpa_supplicant_rsn_preauth_scan_results(wpa_s);
|
wpa_supplicant_rsn_preauth_scan_results(wpa_s);
|
||||||
} else {
|
} else {
|
||||||
int timeout_sec = wpa_s->scan_interval;
|
int timeout_sec = wpa_s->scan_interval;
|
||||||
|
@ -1351,7 +1356,7 @@ int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return wpas_select_network_from_last_scan(wpa_s);
|
return wpas_select_network_from_last_scan(wpa_s, 0);
|
||||||
#endif /* CONFIG_NO_SCAN_PROCESSING */
|
#endif /* CONFIG_NO_SCAN_PROCESSING */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue