]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Update operating class on channel changes in the fallback case
authorJouni Malinen <jouni.malinen@oss.qualcomm.com>
Thu, 9 Oct 2025 22:06:56 +0000 (01:06 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 9 Oct 2025 22:06:56 +0000 (01:06 +0300)
Some of the DFS channel change operations seemed to fail when moving to
new channel based on radar detection without updating the op_class
configuration to match the new channel. Address these by updating
op_class in addition to the channel number in this additional fallback
case.

Fixes: 3bc01a901803 ("Update conf->op_class in hostapd_change_config_freq()")
Signed-off-by: Jouni Malinen <jouni.malinen@oss.qualcomm.com>
src/ap/dfs.c

index a6a68fe3e558402457cc1524bae1d9c79907555e..386910df1e860e49fb200759abdfc66ed6da0d03 100644 (file)
@@ -1054,6 +1054,14 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,
                                                     oper_centr_freq_seg0_idx);
                hostapd_set_oper_centr_freq_seg1_idx(iface->conf,
                                                     oper_centr_freq_seg1_idx);
+               if (ieee80211_freq_to_channel_ext(freq, secondary_channel,
+                                                 new_vht_oper_chwidth,
+                                                 &op_class, &chan) !=
+                   NUM_HOSTAPD_MODES) {
+                       wpa_printf(MSG_DEBUG, "Update op_class %d->%d",
+                                  iface->conf->op_class, op_class);
+                       iface->conf->op_class = op_class;
+               }
 
                hostapd_disable_iface(iface);
                hostapd_enable_iface(iface);