From 8127a0ac02e0d4777f85b194ff606ef59ab670cd Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 21 Mar 2018 16:35:15 +0200 Subject: [PATCH] Ignore intra-BSS 20/40 BSS Coexistence Management from not-associated STA The 20 MHz BSS Width Request field is set to 1 only for intra-BSS reports. As such, ignore the frame if such a claim is made by a transmitter that is not currently associated with the AP. Signed-off-by: Jouni Malinen --- src/ap/ieee802_11_ht.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c index 6920184a6..74c0ec547 100644 --- a/src/ap/ieee802_11_ht.c +++ b/src/ap/ieee802_11_ht.c @@ -236,6 +236,7 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd, int i; const u8 *start = (const u8 *) mgmt; const u8 *data = start + IEEE80211_HDRLEN + 2; + struct sta_info *sta; wpa_printf(MSG_DEBUG, "HT: Received 20/40 BSS Coexistence Management frame from " @@ -287,6 +288,13 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd, if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ) { /* Intra-BSS communication prohibiting 20/40 MHz BSS operation */ + sta = ap_get_sta(hapd, mgmt->sa); + if (!sta || !(sta->flags & WLAN_STA_ASSOC)) { + wpa_printf(MSG_DEBUG, + "Ignore intra-BSS 20/40 BSS Coexistence Management frame from not-associated STA"); + return; + } + hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_DEBUG,