hostapd: merge fixes for WPA packet number reuse with replayed messages and key reins...
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
1 From: Jouni Malinen <j@w1.fi>
2 Date: Fri, 22 Sep 2017 11:25:02 +0300
3 Subject: [PATCH] WNM: Ignore WNM-Sleep Mode Response without pending
4 request
5
6 Commit 03ed0a52393710be6bdae657d1b36efa146520e5 ('WNM: Ignore WNM-Sleep
7 Mode Response if WNM-Sleep Mode has not been used') started ignoring the
8 response when no WNM-Sleep Mode Request had been used during the
9 association. This can be made tighter by clearing the used flag when
10 successfully processing a response. This adds an additional layer of
11 protection against unexpected retransmissions of the response frame.
12
13 Signed-off-by: Jouni Malinen <j@w1.fi>
14 ---
15
16 --- a/wpa_supplicant/wnm_sta.c
17 +++ b/wpa_supplicant/wnm_sta.c
18 @@ -260,7 +260,7 @@ static void ieee802_11_rx_wnmsleep_resp(
19
20 if (!wpa_s->wnmsleep_used) {
21 wpa_printf(MSG_DEBUG,
22 - "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode has not been used in this association");
23 + "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode operation has not been requested");
24 return;
25 }
26
27 @@ -299,6 +299,8 @@ static void ieee802_11_rx_wnmsleep_resp(
28 return;
29 }
30
31 + wpa_s->wnmsleep_used = 0;
32 +
33 if (wnmsleep_ie->status == WNM_STATUS_SLEEP_ACCEPT ||
34 wnmsleep_ie->status == WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) {
35 wpa_printf(MSG_DEBUG, "Successfully recv WNM-Sleep Response "