When we are configuring automatic channel selection, we are not able to
switch to a given DFS channel because when we are trying to move to a
DFS channel, the interface is disabled and enabled again. When the
interface is disabled and enabled we are setting iface's freq and
channel to 0 in setup_interface2() in case ACS is enabled, and now we
don't know to which channel we were trying to move. Now ACS will run and
the interface will be up in the channel that is suitable.
To fix this issue add a flag named is_ch_switch_dfs to check if the
channel switch request is for a DFS channel and we can use this in
setup_interface2() to decide whther we have to set iface's freq and
channel to 0 or not. This way iface's freq and channel will retain the
values while channel switching to a DFS channel when ACS is enabled.
Signed-off-by: Rajat Soni <quic_rajson@quicinc.com>
settings.freq_params.center_freq1);
/* Perform CAC and switch channel */
+ iface->is_ch_switch_dfs = true;
hostapd_switch_channel_fallback(iface, &settings.freq_params);
return 0;
}
} else {
int ret;
- if (iface->conf->acs) {
+ if (iface->conf->acs && !iface->is_ch_switch_dfs) {
iface->freq = 0;
iface->conf->channel = 0;
}
+ iface->is_ch_switch_dfs = false;
ret = configured_fixed_chan_to_freq(iface);
if (ret < 0)
hostapd_bss_setup_multi_link(hapd, interfaces);
}
+ hapd_iface->is_ch_switch_dfs = false;
return hapd_iface;
fail:
/* Configured freq of interface is NO_IR */
bool is_no_ir;
+
+ bool is_ch_switch_dfs; /* Channel switch from ACS to DFS */
};
/* hostapd.c */