]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Ignore WNM-Sleep Mode Response without pending request
authorJouni Malinen <j@w1.fi>
Fri, 22 Sep 2017 08:25:02 +0000 (11:25 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 15 Oct 2017 23:03:47 +0000 (02:03 +0300)
Commit 03ed0a52393710be6bdae657d1b36efa146520e5 ('WNM: Ignore WNM-Sleep
Mode Response if WNM-Sleep Mode has not been used') started ignoring the
response when no WNM-Sleep Mode Request had been used during the
association. This can be made tighter by clearing the used flag when
successfully processing a response. This adds an additional layer of
protection against unexpected retransmissions of the response frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wnm_sta.c

index 7339ed26d2771968434a6632b77fd10dc2703e81..28346ea966c2c54c69a7c71c37eda26a9549e6aa 100644 (file)
@@ -260,7 +260,7 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
 
        if (!wpa_s->wnmsleep_used) {
                wpa_printf(MSG_DEBUG,
-                          "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode has not been used in this association");
+                          "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode operation has not been requested");
                return;
        }
 
@@ -299,6 +299,8 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
                return;
        }
 
+       wpa_s->wnmsleep_used = 0;
+
        if (wnmsleep_ie->status == WNM_STATUS_SLEEP_ACCEPT ||
            wnmsleep_ie->status == WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) {
                wpa_printf(MSG_DEBUG, "Successfully recv WNM-Sleep Response "