]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ACS: Validate 6 GHz AP criteria before ACS
authorTianfeng Ren <quic_tianfeng@quicinc.com>
Wed, 26 Mar 2025 05:42:02 +0000 (11:12 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 28 Mar 2025 08:50:25 +0000 (10:50 +0200)
Ensure that the 6 GHz AP criteria (RSN parameters) are met before
selecting the ACS candidate channels. Currently, hostapd includes 6 GHz
channels as ACS candidates. However, if the BSS configuration does not
comply with 6 GHz AP criteria, ACS might inadvertently start an 6 GHz AP
with configuration that does not meet RSN configuration requirements for
the 6 GHz band.

Add a validation step to check 6 GHz AP criteria before ACS candidates
channel selection.

Signed-off-by: Tianfeng Ren <quic_tianfeng@quicinc.com>
src/ap/ap_config.c
src/ap/ap_config.h
src/ap/ap_drv_ops.c

index 52808c59ba0ad8b105d8e2ba0e17a0d39af68ad3..bbf8a7ba88451c602124951cc848a1b8d30b1e4c 100644 (file)
@@ -1198,7 +1198,7 @@ static bool hostapd_sae_pk_password_without_pk(struct hostapd_bss_config *bss)
 #endif /* CONFIG_SAE_PK */
 
 
-static bool hostapd_config_check_bss_6g(struct hostapd_bss_config *bss)
+bool hostapd_config_check_bss_6g(struct hostapd_bss_config *bss)
 {
        if (bss->wpa != WPA_PROTO_RSN) {
                wpa_printf(MSG_ERROR,
index 02eb4b6fb68d9fb265de5488af5f94e0dc26bd63..af0d785be2281e2ba64f229b3b12f7c140fe2f6e 100644 (file)
@@ -1399,5 +1399,6 @@ int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num,
                            int vlan_id, const u8 *addr);
 void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num,
                            const u8 *addr);
+bool hostapd_config_check_bss_6g(struct hostapd_bss_config *bss);
 
 #endif /* HOSTAPD_CONFIG_H */
index 2133426368db78c85c8dba7a2d2f558198dba37b..b2e930de97cfc6b0d0e0bd8534c0959654c410b2 100644 (file)
@@ -1151,6 +1151,9 @@ void hostapd_get_hw_mode_any_channels(struct hostapd_data *hapd,
 {
        int i;
        bool is_no_ir = false;
+       bool allow_6g_acs = hostapd_config_check_bss_6g(hapd->conf) &&
+               (hapd->iface->conf->ieee80211ax ||
+                hapd->iface->conf->ieee80211be);
 
        for (i = 0; i < mode->num_channels; i++) {
                struct hostapd_channel_data *chan = &mode->channels[i];
@@ -1171,8 +1174,7 @@ void hostapd_get_hw_mode_any_channels(struct hostapd_data *hapd,
                if (is_6ghz_freq(chan->freq) &&
                    ((hapd->iface->conf->acs_exclude_6ghz_non_psc &&
                      !is_6ghz_psc_frequency(chan->freq)) ||
-                    (!hapd->iface->conf->ieee80211ax &&
-                     !hapd->iface->conf->ieee80211be)))
+                    !allow_6g_acs))
                        continue;
                if ((!(chan->flag & HOSTAPD_CHAN_DISABLED) || allow_disabled) &&
                    !(hapd->iface->conf->acs_exclude_dfs &&