Fix PeerKey deinit behavior

PeerKey entries need to be removed on disassociation and this needs to
be done in a way that cancels the possibly pending eloop timeout.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-12-28 14:23:43 +02:00
parent 4472aafbe0
commit 773272989a
2 changed files with 2 additions and 1 deletions

View file

@ -1110,7 +1110,7 @@ void peerkey_deinit(struct wpa_sm *sm)
while (peerkey) { while (peerkey) {
prev = peerkey; prev = peerkey;
peerkey = peerkey->next; peerkey = peerkey->next;
os_free(prev); wpa_supplicant_peerkey_free(sm, prev);
} }
sm->peerkey = NULL; sm->peerkey = NULL;
} }

View file

@ -2098,6 +2098,7 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
*/ */
void wpa_sm_notify_disassoc(struct wpa_sm *sm) void wpa_sm_notify_disassoc(struct wpa_sm *sm)
{ {
peerkey_deinit(sm);
rsn_preauth_deinit(sm); rsn_preauth_deinit(sm);
pmksa_cache_clear_current(sm); pmksa_cache_clear_current(sm);
if (wpa_sm_get_state(sm) == WPA_4WAY_HANDSHAKE) if (wpa_sm_get_state(sm) == WPA_4WAY_HANDSHAKE)