[PATCH] hostapd: fix opclass during CSA with DFS channels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During CSA with DFS channels, disable, enable interface
is a part of the algorithm.
When interface was enabled old operating class before switch
and new channel were used causing mismatch in
configured_fixed_chan_to_freq function.

Example of log when switch from channel 157 to 108 was triggered:
"Could not convert op_class 124 channel 108 to operating frequency"

Fixes: bb781c763 ("AP: Populate iface->freq before starting AP")

Signed-off-by: Marek Kwaczynski <marek@xxxxxxxxxx>
---
 src/ap/hostapd.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 130b6ebc6..8d0601e6a 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -4466,6 +4466,8 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
 {
        u8 seg0_idx = 0, seg1_idx = 0;
        enum oper_chan_width bw = CONF_OPER_CHWIDTH_USE_HT;
+       u8 op_class;
+       u8 chan;

        wpa_printf(MSG_DEBUG, "Restarting all CSA-related BSSes");

@@ -4505,6 +4507,11 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
        iface->freq = freq_params->freq;
        iface->conf->channel = freq_params->channel;
iface->conf->secondary_channel = freq_params->sec_channel_offset; + ieee80211_freq_to_channel_ext(freq_params->freq, freq_params->sec_channel_offset, bw, &op_class, &chan);
+       if (chan != freq_params->channel)
+ wpa_printf(MSG_ERROR, "Channel mismatch: %d -> %d", freq_params->channel, chan);
+
+       iface->conf->op_class = op_class;
        hostapd_set_oper_centr_freq_seg0_idx(iface->conf, seg0_idx);
        hostapd_set_oper_centr_freq_seg1_idx(iface->conf, seg1_idx);
        hostapd_set_oper_chwidth(iface->conf, bw);
--
2.34.1

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux