[PATCH 3/4] wpa_supplicant: Fix creating 6GHz ibss/mesh on 5/6 GHz-capable phys

Nicolas Cavallari nicolas.cavallari at green-communications.fr
Wed Feb 15 09:02:52 PST 2023


If the phy supports both 5 GHz and 6 GHz bands, then there will be two
different struct hostapd_hw_modes with mode HOSTAPD_MODE_IEEE80211A,
one for each band, with potentially different capabilities.

Check that the struct hostapd_hw_modes actually contains the frequency
before selecting it.

Signed-off-by: Nicolas Cavallari <nicolas.cavallari at green-communications.fr>
---
 wpa_supplicant/wpa_supplicant.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 6dc581ad8..9ed79abab 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2996,7 +2996,9 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
 
 	hw_mode = ieee80211_freq_to_chan(freq->freq, &channel);
 	for (i = 0; wpa_s->hw.modes && i < wpa_s->hw.num_modes; i++) {
-		if (wpa_s->hw.modes[i].mode == hw_mode) {
+		if (wpa_s->hw.modes[i].mode == hw_mode &&
+		    hw_mode_get_channel(&wpa_s->hw.modes[i], freq->freq,
+					NULL) != NULL) {
 			mode = &wpa_s->hw.modes[i];
 			break;
 		}
-- 
2.39.1




More information about the Hostap mailing list