wpa_supplicant: Apply same restrictions for MLD as for 6 GHz BSS

Though not explicitely forced by IEEE 802.11be draft yet, it makes sense
to apply the same logic for MLD as for 6 GHz BSSs. Change
wpa_supplicant_ssid_bss_match() accordingly.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Andrei Otcheretianski 2022-11-30 15:09:39 +02:00 committed by Jouni Malinen
parent 7216f79b94
commit 7d8b96dcfd

View file

@ -608,7 +608,8 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_WEP #ifdef CONFIG_WEP
int wep_ok; int wep_ok;
#endif /* CONFIG_WEP */ #endif /* CONFIG_WEP */
bool is_6ghz_bss = is_6ghz_freq(bss->freq); bool is_6ghz_bss_or_mld = is_6ghz_freq(bss->freq) ||
!is_zero_ether_addr(bss->mld_addr);
ret = wpas_wps_ssid_bss_match(wpa_s, ssid, bss); ret = wpas_wps_ssid_bss_match(wpa_s, ssid, bss);
if (ret >= 0) if (ret >= 0)
@ -623,10 +624,10 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_WEP */ #endif /* CONFIG_WEP */
rsn_ie = wpa_bss_get_ie(bss, WLAN_EID_RSN); rsn_ie = wpa_bss_get_ie(bss, WLAN_EID_RSN);
if (is_6ghz_bss && !rsn_ie) { if (is_6ghz_bss_or_mld && !rsn_ie) {
if (debug_print) if (debug_print)
wpa_dbg(wpa_s, MSG_DEBUG, wpa_dbg(wpa_s, MSG_DEBUG,
" skip - 6 GHz BSS without RSNE"); " skip - 6 GHz/MLD BSS without RSNE");
return 0; return 0;
} }
@ -644,7 +645,7 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
if (!ie.has_group) if (!ie.has_group)
ie.group_cipher = wpa_default_rsn_cipher(bss->freq); ie.group_cipher = wpa_default_rsn_cipher(bss->freq);
if (is_6ghz_bss) { if (is_6ghz_bss_or_mld) {
/* WEP and TKIP are not allowed on 6 GHz */ /* WEP and TKIP are not allowed on 6 GHz */
ie.pairwise_cipher &= ~(WPA_CIPHER_WEP40 | ie.pairwise_cipher &= ~(WPA_CIPHER_WEP40 |
WPA_CIPHER_WEP104 | WPA_CIPHER_WEP104 |
@ -695,12 +696,12 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
break; break;
} }
if (is_6ghz_bss) { if (is_6ghz_bss_or_mld) {
/* MFPC must be supported on 6 GHz */ /* MFPC must be supported on 6 GHz */
if (!(ie.capabilities & WPA_CAPABILITY_MFPC)) { if (!(ie.capabilities & WPA_CAPABILITY_MFPC)) {
if (debug_print) if (debug_print)
wpa_dbg(wpa_s, MSG_DEBUG, wpa_dbg(wpa_s, MSG_DEBUG,
" skip RSNE - 6 GHz without MFPC"); " skip RSNE - 6 GHz/MLD without MFPC");
break; break;
} }
@ -740,10 +741,10 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
return 1; return 1;
} }
if (is_6ghz_bss) { if (is_6ghz_bss_or_mld) {
if (debug_print) if (debug_print)
wpa_dbg(wpa_s, MSG_DEBUG, wpa_dbg(wpa_s, MSG_DEBUG,
" skip - 6 GHz BSS without matching RSNE"); " skip - 6 GHz/MLD BSS without matching RSNE");
return 0; return 0;
} }