Interworking: Fix last-network preference to not override priority
Commit 3d910ef497
tried to make
last-network selection behave more consistently with Interworking
network selection preferences. However, it did not take into account
that other network block may have higher priority. In such cases, the
last added network from Interworking network selection should actually
not be selected for the next connection. Fix this by limiting the
last-network preference to work only within a priority class.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
1815317906
commit
7c373ac267
1 changed files with 17 additions and 14 deletions
|
@ -993,30 +993,33 @@ struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
|
||||||
{
|
{
|
||||||
struct wpa_bss *selected = NULL;
|
struct wpa_bss *selected = NULL;
|
||||||
int prio;
|
int prio;
|
||||||
|
struct wpa_ssid *next_ssid = NULL;
|
||||||
|
|
||||||
if (wpa_s->last_scan_res == NULL ||
|
if (wpa_s->last_scan_res == NULL ||
|
||||||
wpa_s->last_scan_res_used == 0)
|
wpa_s->last_scan_res_used == 0)
|
||||||
return NULL; /* no scan results from last update */
|
return NULL; /* no scan results from last update */
|
||||||
|
|
||||||
|
if (wpa_s->next_ssid) {
|
||||||
|
struct wpa_ssid *ssid;
|
||||||
|
|
||||||
|
/* check that next_ssid is still valid */
|
||||||
|
for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next) {
|
||||||
|
if (ssid == wpa_s->next_ssid)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
next_ssid = ssid;
|
||||||
|
wpa_s->next_ssid = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
while (selected == NULL) {
|
while (selected == NULL) {
|
||||||
if (wpa_s->next_ssid) {
|
for (prio = 0; prio < wpa_s->conf->num_prio; prio++) {
|
||||||
struct wpa_ssid *ssid;
|
if (next_ssid && next_ssid->priority ==
|
||||||
|
wpa_s->conf->pssid[prio]->priority) {
|
||||||
/* check that next_ssid is still valid */
|
|
||||||
for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next)
|
|
||||||
if (ssid == wpa_s->next_ssid)
|
|
||||||
break;
|
|
||||||
wpa_s->next_ssid = NULL;
|
|
||||||
|
|
||||||
if (ssid) {
|
|
||||||
selected = wpa_supplicant_select_bss(
|
selected = wpa_supplicant_select_bss(
|
||||||
wpa_s, ssid, selected_ssid, 1);
|
wpa_s, next_ssid, selected_ssid, 1);
|
||||||
if (selected)
|
if (selected)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (prio = 0; prio < wpa_s->conf->num_prio; prio++) {
|
|
||||||
selected = wpa_supplicant_select_bss(
|
selected = wpa_supplicant_select_bss(
|
||||||
wpa_s, wpa_s->conf->pssid[prio],
|
wpa_s, wpa_s->conf->pssid[prio],
|
||||||
selected_ssid, 0);
|
selected_ssid, 0);
|
||||||
|
|
Loading…
Reference in a new issue