From: Jouni Malinen Date: Thu, 9 Oct 2025 22:06:56 +0000 (+0300) Subject: DFS: Update operating class on channel changes in the fallback case X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=561655d42fee97d83f18dcfdf05851e4980143c3;p=thirdparty%2Fhostap.git DFS: Update operating class on channel changes in the fallback case 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 --- diff --git a/src/ap/dfs.c b/src/ap/dfs.c index a6a68fe3e..386910df1 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -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);