Fixed race condition between disassociation event and group key handshake
This avoids getting stuck in state where wpa_supplicant has canceled scans, but the driver is actually in disassociated state. The previously used code that controlled scan timeout from WPA module is not really needed anymore (and has not been needed for past four years since authentication timeout was separated from scan request timeout), so this can simply be removed to resolved the race condition. As an extra bonus, this simplifies the interface to WPA module. [Bug 261]
This commit is contained in:
parent
2eeaa5c9d0
commit
3e2ad1b932
6 changed files with 6 additions and 46 deletions
|
@ -450,7 +450,6 @@ static void wpa_supplicant_key_neg_complete(struct wpa_sm *sm,
|
|||
MACSTR " [PTK=%s GTK=%s]", MAC2STR(addr),
|
||||
wpa_cipher_txt(sm->pairwise_cipher),
|
||||
wpa_cipher_txt(sm->group_cipher));
|
||||
wpa_sm_cancel_scan(sm);
|
||||
wpa_sm_cancel_auth_timeout(sm);
|
||||
wpa_sm_set_state(sm, WPA_COMPLETED);
|
||||
|
||||
|
@ -782,7 +781,6 @@ static void wpa_report_ie_mismatch(struct wpa_sm *sm,
|
|||
}
|
||||
|
||||
wpa_sm_disassociate(sm, WLAN_REASON_IE_IN_4WAY_DIFFERS);
|
||||
wpa_sm_req_scan(sm, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1790,7 +1788,6 @@ static void wpa_sm_pmksa_free_cb(struct rsn_pmksa_cache_entry *entry,
|
|||
|
||||
os_memset(sm->pmk, 0, sizeof(sm->pmk));
|
||||
wpa_sm_deauthenticate(sm, WLAN_REASON_UNSPECIFIED);
|
||||
wpa_sm_req_scan(sm, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,8 +36,6 @@ struct wpa_sm_ctx {
|
|||
|
||||
void (*set_state)(void *ctx, wpa_states state);
|
||||
wpa_states (*get_state)(void *ctx);
|
||||
void (*req_scan)(void *ctx, int sec, int usec);
|
||||
void (*cancel_scan)(void *ctx);
|
||||
void (*deauthenticate)(void * ctx, int reason_code);
|
||||
void (*disassociate)(void *ctx, int reason_code);
|
||||
int (*set_key)(void *ctx, wpa_alg alg,
|
||||
|
|
|
@ -120,18 +120,6 @@ static inline wpa_states wpa_sm_get_state(struct wpa_sm *sm)
|
|||
return sm->ctx->get_state(sm->ctx->ctx);
|
||||
}
|
||||
|
||||
static inline void wpa_sm_req_scan(struct wpa_sm *sm, int sec, int usec)
|
||||
{
|
||||
WPA_ASSERT(sm->ctx->req_scan);
|
||||
sm->ctx->req_scan(sm->ctx->ctx, sec, usec);
|
||||
}
|
||||
|
||||
static inline void wpa_sm_cancel_scan(struct wpa_sm *sm)
|
||||
{
|
||||
WPA_ASSERT(sm->ctx->cancel_scan);
|
||||
sm->ctx->cancel_scan(sm->ctx->ctx);
|
||||
}
|
||||
|
||||
static inline void wpa_sm_deauthenticate(struct wpa_sm *sm, int reason_code)
|
||||
{
|
||||
WPA_ASSERT(sm->ctx->deauthenticate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue