]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix mesh 6 GHz incorrect channel bandwidth
authorHarshitha Prem <quic_hprem@quicinc.com>
Fri, 12 Jul 2024 07:34:21 +0000 (13:04 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 12 Jul 2024 09:17:04 +0000 (12:17 +0300)
When the wiphy supports multiple bands and reports different capability
values between 5 GHz and 6 GHz channels, the 6 GHz mesh interface is
unable to correctly map the channel width in function
ibss_mesh_setup_freq(). This issue arises because the modes of 5 GHz and
6 GHz interfaces are the same (HOSTAPD_MODE_IEEE80211A) in supported
modes.

To address this, use function get_mode() to determine the appropriate
mode during mesh setup. This will iterates through all the hw_features
sets and ensures compatibility with the band of the channel supported in
hw_features set.

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
wpa_supplicant/wpa_supplicant.c

index b679103c30f58f820be4dac4875a266232212a89..17e5315005e3bab8600641db83aaa9b074ec2bbf 100644 (file)
@@ -3189,7 +3189,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
        int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode);
        enum hostapd_hw_mode hw_mode;
        struct hostapd_hw_modes *mode = NULL;
-       int i, obss_scan = 1;
+       int obss_scan = 1;
        u8 channel;
        bool is_6ghz, is_24ghz;
 
@@ -3208,14 +3208,8 @@ 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 &&
-                   hw_mode_get_channel(&wpa_s->hw.modes[i], freq->freq,
-                                       NULL) != NULL) {
-                       mode = &wpa_s->hw.modes[i];
-                       break;
-               }
-       }
+       mode = get_mode(wpa_s->hw.modes, wpa_s->hw.num_modes,
+                       hw_mode, is_6ghz_freq(ssid->frequency));
 
        if (!mode)
                return;