hostapd: backport fix for wnm_sleep_mode=0
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch
1 From 114f2830d2c2aee6db23d48240e93415a256a37c Mon Sep 17 00:00:00 2001
2 From: Jouni Malinen <jouni@qca.qualcomm.com>
3 Date: Fri, 20 Oct 2017 17:39:42 +0300
4 Subject: [PATCH] WNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case
5
6 The hostapd wnm_sleep_mode parameter was previously used to control
7 advertisement of WNM-Sleep Mode support, but it was not used when
8 processing a request to use WNM-Sleep Mode. Add an explicit check during
9 request processing as well so that any misbehaving station is ignored.
10
11 Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
12 ---
13 src/ap/wnm_ap.c | 7 +++++++
14 1 file changed, 7 insertions(+)
15
16 diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c
17 index 7c4fde0..973e4d3 100644
18 --- a/src/ap/wnm_ap.c
19 +++ b/src/ap/wnm_ap.c
20 @@ -200,6 +200,13 @@ static void ieee802_11_rx_wnmsleep_req(struct hostapd_data *hapd,
21 u8 *tfsreq_ie_end = NULL;
22 u16 tfsreq_ie_len = 0;
23
24 + if (!hapd->conf->wnm_sleep_mode) {
25 + wpa_printf(MSG_DEBUG, "Ignore WNM-Sleep Mode Request from "
26 + MACSTR " since WNM-Sleep Mode is disabled",
27 + MAC2STR(addr));
28 + return;
29 + }
30 +
31 dialog_token = *pos++;
32 while (pos + 1 < frm + len) {
33 u8 ie_len = pos[1];
34 --
35 2.1.4