In case AP sends disassociate to sta wpa_supplicant generates a deauthenticate event to clear driver state and also turns on the ignore_next_local_deauth flag expecting to get a deauth event for a locally generated deauth. However, no deauth or disconnect events are received, since sta is already marked as disconnected. AP will connect to AP2 (the new AP) but if connection to AP2 is lost deauth event to wpa_supplicant will be ignored since the ignore_next_local_deauth was never set to 0. So wpa_supplicant is unaware that station is disconnected and does not initiate scan. Fix: Set ignore_next_local_deauth flag to 0 upon connection Signed-off-by: Sarada Prasanna Garnayak <sarada.prasanna.garnayak@xxxxxxxxx> --- src/drivers/driver_nl80211_event.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index bac83898d..8c0a844f5 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -248,6 +248,18 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv, return; } + if (drv->ignore_next_local_deauth == 1){ + /* + * In case the flag to ignore deauth event triggered by local + * deauthentication was not reset (because kernel did not actually + * send the deauth event) reset ignore_next_local_deauth flag. + */ + wpa_printf(MSG_DEBUG, + "nl80211: Resetting flag that prevents raising deauth" + "event triggered by local deauth"); + drv->ignore_next_local_deauth = 0; + } + drv->associated = 1; os_memcpy(drv->bssid, mgmt->sa, ETH_ALEN); os_memcpy(drv->prev_bssid, mgmt->sa, ETH_ALEN); -- 2.11.0 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap