]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 20 Oct 2017 14:39:42 +0000 (17:39 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 20 Oct 2017 14:39:42 +0000 (17:39 +0300)
The hostapd wnm_sleep_mode parameter was previously used to control
advertisement of WNM-Sleep Mode support, but it was not used when
processing a request to use WNM-Sleep Mode. Add an explicit check during
request processing as well so that any misbehaving station is ignored.

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

index 7c4fde08d823f0cdba08a834e7c27d3b8e585f70..973e4d332536fff43680ba7654e1c2e36317b898 100644 (file)
@@ -200,6 +200,13 @@ static void ieee802_11_rx_wnmsleep_req(struct hostapd_data *hapd,
        u8 *tfsreq_ie_end = NULL;
        u16 tfsreq_ie_len = 0;
 
+       if (!hapd->conf->wnm_sleep_mode) {
+               wpa_printf(MSG_DEBUG, "Ignore WNM-Sleep Mode Request from "
+                          MACSTR " since WNM-Sleep Mode is disabled",
+                          MAC2STR(addr));
+               return;
+       }
+
        dialog_token = *pos++;
        while (pos + 1 < frm + len) {
                u8 ie_len = pos[1];