diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index 38f276446..97c0405d3 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -2625,7 +2625,7 @@ size_t add_multi_ap_ie(u8 *buf, size_t len, u8 *pos = buf; u8 *len_ptr; - if (len < 9) + if (len < 6) return 0; *pos++ = WLAN_EID_VENDOR_SPECIFIC; @@ -2636,10 +2636,21 @@ size_t add_multi_ap_ie(u8 *buf, size_t len, *pos++ = MULTI_AP_OUI_TYPE; /* Multi-AP Extension subelement */ + if (buf + len - pos < 3) + return 0; *pos++ = MULTI_AP_SUB_ELEM_TYPE; *pos++ = 1; /* len */ *pos++ = multi_ap->capability; + /* Add Multi-AP Profile subelement only for R2 or newer configuration */ + if (multi_ap->profile >= MULTI_AP_PROFILE_2) { + if (buf + len - pos < 3) + return 0; + *pos++ = MULTI_AP_PROFILE_SUB_ELEM_TYPE; + *pos++ = 1; + *pos++ = multi_ap->profile; + } + *len_ptr = pos - len_ptr - 1; return pos - buf; diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index d038d210b..cd04666ba 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -32,6 +32,7 @@ struct mb_ies_info { struct multi_ap_params { u8 capability; + u8 profile; }; /* Parsed Information Elements */ diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index d070e42b8..147ab7322 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -1447,11 +1447,17 @@ struct ieee80211_ampe_ie { #define WFA_CAPA_OUI_TYPE 0x23 #define MULTI_AP_SUB_ELEM_TYPE 0x06 +#define MULTI_AP_PROFILE_SUB_ELEM_TYPE 0x07 + #define MULTI_AP_TEAR_DOWN BIT(4) #define MULTI_AP_FRONTHAUL_BSS BIT(5) #define MULTI_AP_BACKHAUL_BSS BIT(6) #define MULTI_AP_BACKHAUL_STA BIT(7) +#define MULTI_AP_PROFILE_1 1 +#define MULTI_AP_PROFILE_2 2 +#define MULTI_AP_PROFILE_MAX 6 + #define WMM_OUI_TYPE 2 #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0 #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1