]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Ignore intra-BSS 20/40 BSS Coexistence Management from not-associated STA
authorJouni Malinen <jouni@codeaurora.org>
Wed, 21 Mar 2018 14:35:15 +0000 (16:35 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 21 Mar 2018 14:35:15 +0000 (16:35 +0200)
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 <jouni@codeaurora.org>
src/ap/ieee802_11_ht.c

index 6920184a632cfc401284cad7f219401b1b618724..74c0ec547151d2a69ab1fcf293823814412b2afc 100644 (file)
@@ -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,