From: P Praneesh Date: Thu, 10 Apr 2025 11:11:21 +0000 (+0530) Subject: mesh: Handle DFS CAC for secondary 80 MHz in 160 MHz cases X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7601f37176410c58471ce84324dfc57a327482a;p=thirdparty%2Fhostap.git mesh: Handle DFS CAC for secondary 80 MHz in 160 MHz cases 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 Signed-off-by: Suraj P Kizhakkethil --- diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c index bd5b5ff9c..297d644e5 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -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];