From 7b3815cd66132ec32d5f8fadc2fa5f137d7eb1c9 Mon Sep 17 00:00:00 2001 From: Nagarajan Maran Date: Tue, 5 Jul 2022 11:38:25 +0530 Subject: [PATCH] hostapd: Add config to truncate ext capabilities Certain legacy clients are not able to scan 11ax vaps due to extended capabilities which are more than 8bytes in length. Hence added a work around to trucate the ext caps to 8bytes based on the hostapd config ext_cap_len. Legacy clients are able to scan and connect if hostapd config as ext_cap_len=8, ieee80211ac=1, ieee80211ax=0 Signed-off-by: Nagarajan Maran --- hostapd/config_file.c | 2 ++ src/ap/ap_config.h | 1 + ap/ieee802_11_shared.c | 3 +++ 3 files changed, 6 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 009abb06cb22..794532f0ce00 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -2344,6 +2344,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, conf->country[2] = strtol(pos, NULL, 16); } else if (os_strcmp(buf, "ieee80211d") == 0) { conf->ieee80211d = atoi(pos); + } else if (os_strcmp(buf, "ext_cap_len") == 0) { + conf->ext_cap_len = atoi(pos); } else if (os_strcmp(buf, "ieee80211h") == 0) { conf->ieee80211h = atoi(pos); } else if (os_strcmp(buf, "dfs_test_mode") == 0) { diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 44d617363a13..163f24dd8dd3 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -1036,6 +1036,7 @@ struct hostapd_config { /* Use driver-generated interface addresses when adding multiple BSSs */ u8 use_driver_iface_addr; u8 skip_unii1_dfs_switch; + u8 ext_cap_len; #ifdef CONFIG_FST struct fst_iface_cfg fst_cfg; diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c index 89fa47241c43..2861f540b02b 100644 --- a/src/ap/ieee802_11_shared.c +++ b/src/ap/ieee802_11_shared.c @@ -530,6 +530,9 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid) if (len == 0) return eid; + if (hapd->iconf->ext_cap_len > 0 && hapd->iconf->ext_cap_len < len) + len = hapd->iconf->ext_cap_len; + *pos++ = WLAN_EID_EXT_CAPAB; *pos++ = len; for (i = 0; i < len; i++, pos++) { -- 2.17.1