Fix BSS selection with multiple configured networks
Commit d8d940b746
broke the logic on
iterating through all configured network blocks. This was supposed
to continue the loop on mismatch to allow other than the first
configured network to be found.
This commit is contained in:
parent
60da5e0f3f
commit
0c703df32d
1 changed files with 8 additions and 8 deletions
|
@ -457,7 +457,7 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
|
||||||
|
|
||||||
if (ssid->disabled) {
|
if (ssid->disabled) {
|
||||||
wpa_printf(MSG_DEBUG, " skip - disabled");
|
wpa_printf(MSG_DEBUG, " skip - disabled");
|
||||||
return 0;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_WPS
|
#ifdef CONFIG_WPS
|
||||||
|
@ -480,17 +480,17 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
|
||||||
(ssid_len != ssid->ssid_len ||
|
(ssid_len != ssid->ssid_len ||
|
||||||
os_memcmp(ssid_, ssid->ssid, ssid_len) != 0)) {
|
os_memcmp(ssid_, ssid->ssid, ssid_len) != 0)) {
|
||||||
wpa_printf(MSG_DEBUG, " skip - SSID mismatch");
|
wpa_printf(MSG_DEBUG, " skip - SSID mismatch");
|
||||||
return 0;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ssid->bssid_set &&
|
if (ssid->bssid_set &&
|
||||||
os_memcmp(bss->bssid, ssid->bssid, ETH_ALEN) != 0) {
|
os_memcmp(bss->bssid, ssid->bssid, ETH_ALEN) != 0) {
|
||||||
wpa_printf(MSG_DEBUG, " skip - BSSID mismatch");
|
wpa_printf(MSG_DEBUG, " skip - BSSID mismatch");
|
||||||
return 0;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wpa && !wpa_supplicant_ssid_bss_match(wpa_s, ssid, bss))
|
if (wpa && !wpa_supplicant_ssid_bss_match(wpa_s, ssid, bss))
|
||||||
return 0;
|
continue;
|
||||||
|
|
||||||
if (!wpa &&
|
if (!wpa &&
|
||||||
!(ssid->key_mgmt & WPA_KEY_MGMT_NONE) &&
|
!(ssid->key_mgmt & WPA_KEY_MGMT_NONE) &&
|
||||||
|
@ -498,24 +498,24 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
|
||||||
!(ssid->key_mgmt & WPA_KEY_MGMT_IEEE8021X_NO_WPA)) {
|
!(ssid->key_mgmt & WPA_KEY_MGMT_IEEE8021X_NO_WPA)) {
|
||||||
wpa_printf(MSG_DEBUG, " skip - non-WPA network not "
|
wpa_printf(MSG_DEBUG, " skip - non-WPA network not "
|
||||||
"allowed");
|
"allowed");
|
||||||
return 0;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wpa && !wpa_supplicant_match_privacy(bss, ssid)) {
|
if (!wpa && !wpa_supplicant_match_privacy(bss, ssid)) {
|
||||||
wpa_printf(MSG_DEBUG, " skip - privacy mismatch");
|
wpa_printf(MSG_DEBUG, " skip - privacy mismatch");
|
||||||
return 0;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wpa && (bss->caps & IEEE80211_CAP_IBSS)) {
|
if (!wpa && (bss->caps & IEEE80211_CAP_IBSS)) {
|
||||||
wpa_printf(MSG_DEBUG, " skip - IBSS (adhoc) "
|
wpa_printf(MSG_DEBUG, " skip - IBSS (adhoc) "
|
||||||
"network");
|
"network");
|
||||||
return 0;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!freq_allowed(ssid->freq_list, bss->freq)) {
|
if (!freq_allowed(ssid->freq_list, bss->freq)) {
|
||||||
wpa_printf(MSG_DEBUG, " skip - frequency not "
|
wpa_printf(MSG_DEBUG, " skip - frequency not "
|
||||||
"allowed");
|
"allowed");
|
||||||
return 0;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Matching configuration found */
|
/* Matching configuration found */
|
||||||
|
|
Loading…
Reference in a new issue