]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Ignore BSS Transition Management frames in bss_transition=0 case
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 20 Oct 2017 14:44:07 +0000 (17:44 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 20 Oct 2017 17:32:36 +0000 (20:32 +0300)
The hostapd bss_transition parameter was previously used to control
advertisement of BSS Transition Management support, but it was not used
when processing BSS Transition Management Query/Response frames. Add an
explicit check during frame processing as well so that any misbehaving
station is ignored. In addition to bss_transition=1, allow mbo=1 to be
used to mark the functionality enabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/wnm_ap.c

index 973e4d332536fff43680ba7654e1c2e36317b898..bbc26a5a2defd1a08f98e8705e121943c8cf0242 100644 (file)
@@ -302,6 +302,20 @@ static void ieee802_11_rx_bss_trans_mgmt_query(struct hostapd_data *hapd,
 {
        u8 dialog_token, reason;
        const u8 *pos, *end;
+       int enabled = hapd->conf->bss_transition;
+
+#ifdef CONFIG_MBO
+       if (hapd->conf->mbo_enabled)
+               enabled = 1;
+#endif /* CONFIG_MBO */
+       if (!enabled) {
+               wpa_printf(MSG_DEBUG,
+                          "Ignore BSS Transition Management Query from "
+                          MACSTR
+                          " since BSS Transition Management is disabled",
+                          MAC2STR(addr));
+               return;
+       }
 
        if (len < 2) {
                wpa_printf(MSG_DEBUG, "WNM: Ignore too short BSS Transition Management Query from "
@@ -331,6 +345,20 @@ static void ieee802_11_rx_bss_trans_mgmt_resp(struct hostapd_data *hapd,
 {
        u8 dialog_token, status_code, bss_termination_delay;
        const u8 *pos, *end;
+       int enabled = hapd->conf->bss_transition;
+
+#ifdef CONFIG_MBO
+       if (hapd->conf->mbo_enabled)
+               enabled = 1;
+#endif /* CONFIG_MBO */
+       if (!enabled) {
+               wpa_printf(MSG_DEBUG,
+                          "Ignore BSS Transition Management Response from "
+                          MACSTR
+                          " since BSS Transition Management is disabled",
+                          MAC2STR(addr));
+               return;
+       }
 
        if (len < 3) {
                wpa_printf(MSG_DEBUG, "WNM: Ignore too short BSS Transition Management Response from "