]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Handle DFS CAC for secondary 80 MHz in 160 MHz cases
authorP Praneesh <quic_ppranees@quicinc.com>
Thu, 10 Apr 2025 11:11:21 +0000 (16:41 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 11 Apr 2025 09:56:26 +0000 (12:56 +0300)
Current implementation of DFS channel validation for mesh checks whether
DFS channels are present or not only for the primary 80 MHz channel in
160 MHz bandwidth, but this approach will fail for channels having
non-DFS channels in primary 80 MHz channel and DFS channels in secondary
80 MHz channel in 160 MHz bandwidth. Example: channel 36. Add DFS check
for both primary 80 MHz and secondary 80 MHz channels in 160 MHz
bandwidth to avoid this issue.

Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
Signed-off-by: Suraj P Kizhakkethil <quic_surapk@quicinc.com>
wpa_supplicant/mesh.c

index bd5b5ff9c502fbd5616ce7b37d8afd5decdc6767..297d644e5621d19b8806355dfaf3545a43317b5a 100644 (file)
@@ -389,6 +389,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
        int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 };
        int rate_len;
        int frequency;
+       bool is_dfs;
        u8 chan;
 
        if (!wpa_s->conf->user_mpm) {
@@ -499,8 +500,16 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
        }
 #endif /* CONFIG_IEEE80211AX */
 
-       if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
-                            wpa_s->hw.num_modes) && wpa_s->conf->country[0]) {
+       is_dfs = ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
+                                 wpa_s->hw.num_modes);
+
+       /* Check if secondary 80 MHz of 160 MHz has DFS channels */
+       if (!is_dfs && freq->bandwidth == 160)
+               is_dfs = ieee80211_is_dfs(ssid->frequency + 80,
+                                         wpa_s->hw.modes,
+                                         wpa_s->hw.num_modes);
+
+       if (is_dfs && wpa_s->conf->country[0]) {
                conf->ieee80211h = 1;
                conf->ieee80211d = 1;
                conf->country[0] = wpa_s->conf->country[0];