Skip to content

Commit 3b3ec3d

Browse files
striebitjmberg-intel
authored andcommitted
mac80211: check the correct bit for EMA AP
An AP supporting EMA (Enhanced Multi-BSSID advertisement) should set bit 83 in the extended capabilities IE (9.4.2.26 in the 802.11ax D5 spec). So the *3rd* bit of the 10th byte should be checked. Also, in one place, the wrong byte was checked. (cfg80211_find_ie returns a pointer to the beginning of the IE, so the data really starts at ie[2], so the 10th byte should be ie[12]. To avoid this confusion, use cfg80211_find_elem instead). Signed-off-by: Shaul Triebitz <[email protected]> Link: https://lore.kernel.org/r/20200528213443.4316121fa2a3.I9745582f8d41ad8e689dac0fefcd70b276d7c1ea@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 57fa5e8 commit 3b3ec3d

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

include/linux/ieee80211.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3082,7 +3082,7 @@ enum ieee80211_tdls_actioncode {
30823082
#define WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT BIT(7)
30833083

30843084
/* Defines support for enhanced multi-bssid advertisement*/
3085-
#define WLAN_EXT_CAPA11_EMA_SUPPORT BIT(1)
3085+
#define WLAN_EXT_CAPA11_EMA_SUPPORT BIT(3)
30863086

30873087
/* TDLS specific payload type in the LLC/SNAP header */
30883088
#define WLAN_TDLS_SNAP_RFTYPE 0x2

net/mac80211/mlme.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5596,7 +5596,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
55965596
assoc_data->timeout_started = true;
55975597
assoc_data->need_beacon = true;
55985598
} else if (beacon_ies) {
5599-
const u8 *ie;
5599+
const struct element *elem;
56005600
u8 dtim_count = 0;
56015601

56025602
ieee80211_get_dtim(beacon_ies, &dtim_count,
@@ -5613,15 +5613,15 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
56135613
sdata->vif.bss_conf.sync_dtim_count = dtim_count;
56145614
}
56155615

5616-
ie = cfg80211_find_ext_ie(WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION,
5617-
beacon_ies->data, beacon_ies->len);
5618-
if (ie && ie[1] >= 3)
5619-
sdata->vif.bss_conf.profile_periodicity = ie[4];
5616+
elem = cfg80211_find_ext_elem(WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION,
5617+
beacon_ies->data, beacon_ies->len);
5618+
if (elem && elem->datalen >= 3)
5619+
sdata->vif.bss_conf.profile_periodicity = elem->data[2];
56205620

5621-
ie = cfg80211_find_ie(WLAN_EID_EXT_CAPABILITY,
5622-
beacon_ies->data, beacon_ies->len);
5623-
if (ie && ie[1] >= 11 &&
5624-
(ie[10] & WLAN_EXT_CAPA11_EMA_SUPPORT))
5621+
elem = cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY,
5622+
beacon_ies->data, beacon_ies->len);
5623+
if (elem && elem->datalen >= 11 &&
5624+
(elem->data[10] & WLAN_EXT_CAPA11_EMA_SUPPORT))
56255625
sdata->vif.bss_conf.ema_ap = true;
56265626
} else {
56275627
assoc_data->timeout = jiffies;

0 commit comments

Comments
 (0)