From: Sara Sharon Date: Tue, 3 Nov 2015 14:24:56 +0000 (+0200) Subject: nl80211: Clear ignore_next_local_deauth and ignore_deauth_event X-Git-Tag: hostap_2_6~1370 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb2a926df83a5167927280d735abfa4328a4265d;p=thirdparty%2Fhostap.git nl80211: Clear ignore_next_local_deauth and ignore_deauth_event The authentication flow in wpa_driver_nl80211_authenticate() can result in a locally generated de-authentication, in which both next_local_deauth and ignore_next_local_deauth are set. However, in mlme_event_deauth_disassoc(), when ignore_deauth_event is set, the flag is cleared, but the flow immediately returns leaving ignore_next_local_deauth set, which can result in ignoring future deauth event from the driver, leaving the wpa_supplicant in an inconsistent state. Fix this by clearing both flags in case that next_local_deauth is set. Signed-off-by: Sara Sharon --- diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index e8cdeeb1b..e982ca8ce 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -691,13 +691,15 @@ static void mlme_event_deauth_disassoc(struct wpa_driver_nl80211_data *drv, mgmt->u.disassoc.variable; } } else { + event.deauth_info.locally_generated = + !os_memcmp(mgmt->sa, drv->first_bss->addr, ETH_ALEN); if (drv->ignore_deauth_event) { wpa_printf(MSG_DEBUG, "nl80211: Ignore deauth event due to previous forced deauth-during-auth"); drv->ignore_deauth_event = 0; + if (event.deauth_info.locally_generated) + drv->ignore_next_local_deauth = 0; return; } - event.deauth_info.locally_generated = - !os_memcmp(mgmt->sa, drv->first_bss->addr, ETH_ALEN); if (drv->ignore_next_local_deauth) { drv->ignore_next_local_deauth = 0; if (event.deauth_info.locally_generated) {