]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix creating 6 GHz IBSS/mesh on 5/6 GHz-capable PHYs
authorNicolas Cavallari <nicolas.cavallari@green-communications.fr>
Wed, 15 Feb 2023 17:02:52 +0000 (18:02 +0100)
committerJouni Malinen <j@w1.fi>
Mon, 20 Feb 2023 22:32:10 +0000 (00:32 +0200)
If the PHY supports both 5 GHz and 6 GHz bands, 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@green-communications.fr>
wpa_supplicant/wpa_supplicant.c

index 8a4da7115575920521b11face1a0cbcb3fb39da4..ca78684d29717e423a39fd6a7caab5c91585d5a1 100644 (file)
@@ -3003,7 +3003,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;
                }