Multi-AP: Add hostapd config option to disallow certain profiles
Add a new config option "multi_ap_client_disallow" to control allowing backhaul STA with certain profiles alone to associate. This is done to adhere to Wi-Fi EasyMesh specification which defined rules to allow/disallow association of backhaul STA of certain profiles. Signed-off-by: Manoj Sekar <quic_sekar@quicinc.com>
This commit is contained in:
parent
9a1512532e
commit
210c2b4bd7
5 changed files with 53 additions and 0 deletions
|
@ -4812,6 +4812,16 @@ static int hostapd_config_fill(struct hostapd_config *conf,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
bss->multi_ap_profile = val;
|
bss->multi_ap_profile = val;
|
||||||
|
} else if (os_strcmp(buf, "multi_ap_client_disallow") == 0) {
|
||||||
|
int val = atoi(pos);
|
||||||
|
|
||||||
|
if (val < 0 || val > 3) {
|
||||||
|
wpa_printf(MSG_ERROR,
|
||||||
|
"Line %d: Invalid multi_ap_client_allow '%s'",
|
||||||
|
line, buf);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
bss->multi_ap_client_disallow = val;
|
||||||
} else if (os_strcmp(buf, "rssi_reject_assoc_rssi") == 0) {
|
} else if (os_strcmp(buf, "rssi_reject_assoc_rssi") == 0) {
|
||||||
conf->rssi_reject_assoc_rssi = atoi(pos);
|
conf->rssi_reject_assoc_rssi = atoi(pos);
|
||||||
} else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) {
|
} else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) {
|
||||||
|
|
|
@ -2571,6 +2571,13 @@ own_ip_addr=127.0.0.1
|
||||||
# 2 = Supports Multi-AP profile 2 as defined in Wi-Fi EasyMesh specification
|
# 2 = Supports Multi-AP profile 2 as defined in Wi-Fi EasyMesh specification
|
||||||
#multi_ap_profile=2
|
#multi_ap_profile=2
|
||||||
|
|
||||||
|
# Multi-AP client disallow
|
||||||
|
# Used to disallow profile specific backhaul STA association
|
||||||
|
# Bitmap of the disallowed Profile-X profiles
|
||||||
|
# 1 = Profile-1 Backhaul STA association disallowed
|
||||||
|
# 2 = Profile-2 Backhaul STA association disallowed
|
||||||
|
#multi_ap_client_disallow=0
|
||||||
|
|
||||||
# WPS UPnP interface
|
# WPS UPnP interface
|
||||||
# If set, support for external Registrars is enabled.
|
# If set, support for external Registrars is enabled.
|
||||||
#upnp_iface=br0
|
#upnp_iface=br0
|
||||||
|
|
|
@ -801,6 +801,11 @@ struct hostapd_bss_config {
|
||||||
#define FRONTHAUL_BSS 2
|
#define FRONTHAUL_BSS 2
|
||||||
int multi_ap; /* bitmap of BACKHAUL_BSS, FRONTHAUL_BSS */
|
int multi_ap; /* bitmap of BACKHAUL_BSS, FRONTHAUL_BSS */
|
||||||
int multi_ap_profile;
|
int multi_ap_profile;
|
||||||
|
/* Multi-AP Profile-1 clients not allowed to connect */
|
||||||
|
#define PROFILE1_CLIENT_ASSOC_DISALLOW BIT(0)
|
||||||
|
/* Multi-AP Profile-2 clients not allowed to connect */
|
||||||
|
#define PROFILE2_CLIENT_ASSOC_DISALLOW BIT(1)
|
||||||
|
unsigned int multi_ap_client_disallow;
|
||||||
|
|
||||||
#ifdef CONFIG_AIRTIME_POLICY
|
#ifdef CONFIG_AIRTIME_POLICY
|
||||||
unsigned int airtime_weight;
|
unsigned int airtime_weight;
|
||||||
|
|
|
@ -100,6 +100,15 @@ static u8 * hostapd_eid_multi_ap(struct hostapd_data *hapd, u8 *eid, size_t len)
|
||||||
if (hapd->conf->multi_ap & FRONTHAUL_BSS)
|
if (hapd->conf->multi_ap & FRONTHAUL_BSS)
|
||||||
multi_ap.capability |= MULTI_AP_FRONTHAUL_BSS;
|
multi_ap.capability |= MULTI_AP_FRONTHAUL_BSS;
|
||||||
|
|
||||||
|
if (hapd->conf->multi_ap_client_disallow &
|
||||||
|
PROFILE1_CLIENT_ASSOC_DISALLOW)
|
||||||
|
multi_ap.capability |=
|
||||||
|
MULTI_AP_PROFILE1_BACKHAUL_STA_DISALLOWED;
|
||||||
|
if (hapd->conf->multi_ap_client_disallow &
|
||||||
|
PROFILE2_CLIENT_ASSOC_DISALLOW)
|
||||||
|
multi_ap.capability |=
|
||||||
|
MULTI_AP_PROFILE2_BACKHAUL_STA_DISALLOWED;
|
||||||
|
|
||||||
multi_ap.profile = hapd->conf->multi_ap_profile;
|
multi_ap.profile = hapd->conf->multi_ap_profile;
|
||||||
|
|
||||||
return eid + add_multi_ap_ie(eid, len, &multi_ap);
|
return eid + add_multi_ap_ie(eid, len, &multi_ap);
|
||||||
|
@ -3449,6 +3458,26 @@ static u16 check_multi_ap(struct hostapd_data *hapd, struct sta_info *sta,
|
||||||
"Multi-AP IE with unexpected value 0x%02x",
|
"Multi-AP IE with unexpected value 0x%02x",
|
||||||
multi_ap.capability);
|
multi_ap.capability);
|
||||||
|
|
||||||
|
if (multi_ap.profile == MULTI_AP_PROFILE_1 &&
|
||||||
|
(hapd->conf->multi_ap_client_disallow &
|
||||||
|
PROFILE1_CLIENT_ASSOC_DISALLOW)) {
|
||||||
|
hostapd_logger(hapd, sta->addr,
|
||||||
|
HOSTAPD_MODULE_IEEE80211,
|
||||||
|
HOSTAPD_LEVEL_INFO,
|
||||||
|
"Multi-AP Profile-1 clients not allowed");
|
||||||
|
return WLAN_STATUS_ASSOC_DENIED_UNSPEC;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (multi_ap.profile >= MULTI_AP_PROFILE_2 &&
|
||||||
|
(hapd->conf->multi_ap_client_disallow &
|
||||||
|
PROFILE2_CLIENT_ASSOC_DISALLOW)) {
|
||||||
|
hostapd_logger(hapd, sta->addr,
|
||||||
|
HOSTAPD_MODULE_IEEE80211,
|
||||||
|
HOSTAPD_LEVEL_INFO,
|
||||||
|
"Multi-AP Profile-2 clients not allowed");
|
||||||
|
return WLAN_STATUS_ASSOC_DENIED_UNSPEC;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(multi_ap.capability & MULTI_AP_BACKHAUL_STA)) {
|
if (!(multi_ap.capability & MULTI_AP_BACKHAUL_STA)) {
|
||||||
if (hapd->conf->multi_ap & FRONTHAUL_BSS)
|
if (hapd->conf->multi_ap & FRONTHAUL_BSS)
|
||||||
return WLAN_STATUS_SUCCESS;
|
return WLAN_STATUS_SUCCESS;
|
||||||
|
|
|
@ -1449,6 +1449,8 @@ struct ieee80211_ampe_ie {
|
||||||
#define MULTI_AP_SUB_ELEM_TYPE 0x06
|
#define MULTI_AP_SUB_ELEM_TYPE 0x06
|
||||||
#define MULTI_AP_PROFILE_SUB_ELEM_TYPE 0x07
|
#define MULTI_AP_PROFILE_SUB_ELEM_TYPE 0x07
|
||||||
|
|
||||||
|
#define MULTI_AP_PROFILE2_BACKHAUL_STA_DISALLOWED BIT(2)
|
||||||
|
#define MULTI_AP_PROFILE1_BACKHAUL_STA_DISALLOWED BIT(3)
|
||||||
#define MULTI_AP_TEAR_DOWN BIT(4)
|
#define MULTI_AP_TEAR_DOWN BIT(4)
|
||||||
#define MULTI_AP_FRONTHAUL_BSS BIT(5)
|
#define MULTI_AP_FRONTHAUL_BSS BIT(5)
|
||||||
#define MULTI_AP_BACKHAUL_BSS BIT(6)
|
#define MULTI_AP_BACKHAUL_BSS BIT(6)
|
||||||
|
|
Loading…
Reference in a new issue