In ap_drv_ops.c, the call to hostapd_config_check_bss_6g() is executed
unconditionally. However, it should only be used when the BSS is
actually configured on a 6 GHz operating class. This leads to false
configuration errors in setups where the 6 GHz BSS has proper settings
but other bands (2.4/5 GHz) share the same config structure.
Add the missing is_6ghz_op_class() condition, mirroring how it's already
used elsewhere in the codebase (e.g., in ap_config.c).
Fix verified on OpenWRT 24.10-SNAPSHOT using Mediatek Wi-Fi 7 hardware.
Fixes: 02a8d40c9ffb ("ACS: Validate 6 GHz AP criteria before ACS")
Signed-off-by: Christopher Söllinger <christopher.soellinger@gmail.com>
{
int i;
bool is_no_ir = false;
- bool allow_6g_acs = hostapd_config_check_bss_6g(hapd->conf) &&
+ bool allow_6g_acs = is_6ghz_op_class(hapd->iconf->op_class) &&
+ hostapd_config_check_bss_6g(hapd->conf) &&
(hapd->iface->conf->ieee80211ax ||
hapd->iface->conf->ieee80211be);