]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Change vht_capab according to user requested bandwidth
authorDmitrijs Martinovs <dmartinovs@maxlinear.com>
Thu, 7 Dec 2023 09:59:10 +0000 (11:59 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 10 Dec 2023 18:58:57 +0000 (20:58 +0200)
There are different CHAN_SWITCH flows for DFS and non-DFS channels.
Non-DFS one saves previous BW value in iface->conf, but DFS flow
replaces it with a new user requested value. Setting a non-DFS channel
after a DFS one with BW = 160 would have resulted in a mismatch between
the saved BW and vht_capab (if VHT160 was not included by default). This
would have led to a check fail in the hostapd_set_freq_params()
function.

Signed-off-by: Dmitrijs Martinovs <dmartinovs@maxlinear.com>
src/ap/hostapd.c

index fea3d8b3c436c97538c3c990084280f4caca1bfc..145463d04ff548607df87d8f72ebeec4365019eb 100644 (file)
@@ -4103,13 +4103,17 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
                bw = CONF_OPER_CHWIDTH_USE_HT;
                break;
        case 80:
-               if (freq_params->center_freq2)
+               if (freq_params->center_freq2) {
                        bw = CONF_OPER_CHWIDTH_80P80MHZ;
-               else
+                       iface->conf->vht_capab |=
+                               VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ;
+               } else {
                        bw = CONF_OPER_CHWIDTH_80MHZ;
+               }
                break;
        case 160:
                bw = CONF_OPER_CHWIDTH_160MHZ;
+               iface->conf->vht_capab |= VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
                break;
        case 320:
                bw = CONF_OPER_CHWIDTH_320MHZ;