]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Fix AP logic on when to include GTK/IGTK in WNM-Sleep Mode exit
authorJouni Malinen <j@w1.fi>
Sun, 16 Dec 2012 17:27:09 +0000 (19:27 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 16 Dec 2012 17:27:09 +0000 (19:27 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

src/ap/wnm_ap.c

index 9f34db258a410fd2b28ba5961200f627624b72ec..51a0e40df5ae04ca65a3267d7931c0ae90c037bf 100644 (file)
@@ -104,7 +104,7 @@ static int ieee802_11_send_wnmsleep_resp(struct hostapd_data *hapd,
        mgmt->u.action.u.wnm_sleep_resp.dialogtoken = dialog_token;
        pos = (u8 *)mgmt->u.action.u.wnm_sleep_resp.variable;
        /* add key data if MFP is enabled */
-       if (wpa_auth_uses_mfp(sta->wpa_sm) ||
+       if (!wpa_auth_uses_mfp(sta->wpa_sm) ||
            action_type != WNM_SLEEP_MODE_EXIT) {
                mgmt->u.action.u.wnm_sleep_resp.keydata_len = 0;
        } else {
@@ -162,13 +162,14 @@ static int ieee802_11_send_wnmsleep_resp(struct hostapd_data *hapd,
                 * 2. start GTK/IGTK update if MFP is not used
                 * 3. unpause the node in driver
                 */
-               if (wnmsleep_ie.status == WNM_STATUS_SLEEP_ACCEPT &&
+               if ((wnmsleep_ie.status == WNM_STATUS_SLEEP_ACCEPT ||
+                    wnmsleep_ie.status ==
+                    WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) &&
                    wnmsleep_ie.action_type == WNM_SLEEP_MODE_EXIT) {
                        wpa_set_wnmsleep(sta->wpa_sm, 0);
                        hostapd_drv_wnm_oper(hapd, WNM_SLEEP_EXIT_CONFIRM,
                                             addr, NULL, NULL);
-                       if (wpa_auth_uses_mfp(sta->wpa_sm) &&
-                           action_type == WNM_SLEEP_MODE_EXIT)
+                       if (!wpa_auth_uses_mfp(sta->wpa_sm))
                                wpa_wnmsleep_rekey_gtk(sta->wpa_sm);
                }
        } else