]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Decrement GKeyDoneStations in WPA authenticator when STA is freed
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 23 Mar 2011 15:00:18 +0000 (17:00 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 23 Mar 2011 15:00:18 +0000 (17:00 +0200)
If the STA to be freed is still included in GKeyDoneStations count,
decrement the count when the STA is freed. This does not happen in
AP mode since there is enough time to go through the authenticator
state machine to clear the STA. However, in the current RSN IBSS
implementation, the authenticator state for the STA is freed in a
way that does not allow the state machine to go through the clearing.
To address this, make sure that wpa_free_sta_sm() decrements the
GKeyDoneStations count if the STA happened to be in the process of
GTK rekeying.

src/ap/wpa_auth.c

index 7ad60a23d999082a00e9be672d4b55a19c46a4bb..157308d1abbb0ec24ab0a9bf02094c7ed75b2e01 100644 (file)
@@ -574,6 +574,10 @@ void wpa_auth_sta_no_wpa(struct wpa_state_machine *sm)
 
 static void wpa_free_sta_sm(struct wpa_state_machine *sm)
 {
+       if (sm->GUpdateStationKeys) {
+               sm->group->GKeyDoneStations--;
+               sm->GUpdateStationKeys = FALSE;
+       }
 #ifdef CONFIG_IEEE80211R
        os_free(sm->assoc_resp_ftie);
 #endif /* CONFIG_IEEE80211R */