From: Jouni Malinen Date: Sat, 28 Aug 2010 09:04:21 +0000 (+0300) Subject: Fix BSS selection with multiple configured networks X-Git-Tag: hostap-1-bp~1213 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c703df32d47868b755a74c552c4910e97404c58;p=thirdparty%2Fhostap.git Fix BSS selection with multiple configured networks Commit d8d940b7469e505aec4d71a02d3f7ebab412eeae 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. --- diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 6924a56c4..ef2cd4529 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -457,7 +457,7 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s, if (ssid->disabled) { wpa_printf(MSG_DEBUG, " skip - disabled"); - return 0; + continue; } #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 || os_memcmp(ssid_, ssid->ssid, ssid_len) != 0)) { wpa_printf(MSG_DEBUG, " skip - SSID mismatch"); - return 0; + continue; } if (ssid->bssid_set && os_memcmp(bss->bssid, ssid->bssid, ETH_ALEN) != 0) { wpa_printf(MSG_DEBUG, " skip - BSSID mismatch"); - return 0; + continue; } if (wpa && !wpa_supplicant_ssid_bss_match(wpa_s, ssid, bss)) - return 0; + continue; if (!wpa && !(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)) { wpa_printf(MSG_DEBUG, " skip - non-WPA network not " "allowed"); - return 0; + continue; } if (!wpa && !wpa_supplicant_match_privacy(bss, ssid)) { wpa_printf(MSG_DEBUG, " skip - privacy mismatch"); - return 0; + continue; } if (!wpa && (bss->caps & IEEE80211_CAP_IBSS)) { wpa_printf(MSG_DEBUG, " skip - IBSS (adhoc) " "network"); - return 0; + continue; } if (!freq_allowed(ssid->freq_list, bss->freq)) { wpa_printf(MSG_DEBUG, " skip - frequency not " "allowed"); - return 0; + continue; } /* Matching configuration found */