[PATCH] hostapd: safe call to hostapd_config_check_bss_6g()

Christopher Söllinger christopher.soellinger at gmail.com
Mon Jun 23 12:11:42 PDT 2025


From: Christopher Söllinger <christopher.soellinger at gmail.com>
Subject: [PATCH] hostapd: fix incorrect call to hostapd_config_check_bss_6g()

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.

This patch adds 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.

Signed-off-by: Christopher Söllinger <christopher.soellinger at gmail.com>

---
 src/ap/ap_drv_ops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index d7a0c7e..3cfe6ce 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -1220,7 +1220,8 @@ static int hostapd_prepare_rates(struct
hostapd_data *hapd,
 {
     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);



More information about the Hostap mailing list