From 4551dd90608fe3d5b5a0f3bc0b5ddf7a5aa445ee Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 21 Dec 2011 13:36:13 +0200 Subject: [PATCH] Ignore disassociation event in wpa_supplicant AP mode If the driver was associated in station mode just before the AP mode was started, the station mode disassociation event may end up getting delivered to wpa_supplicant only after the AP mode has been started. This can result in unexpected attempt to reassociate back to the network that was previously used in station mode. Avoid this by ignoring the disassociation event. Signed-hostap: Jouni Malinen --- wpa_supplicant/events.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index ef9e1c301..fd04ad2e7 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -2039,6 +2039,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, data->disassoc_info.addr); break; } + if (wpa_s->ap_iface) { + wpa_dbg(wpa_s, MSG_DEBUG, "Ignore disassoc event in " + "AP mode"); + break; + } #endif /* CONFIG_AP */ if (data) { reason_code = data->disassoc_info.reason_code; @@ -2088,6 +2093,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, data->deauth_info.addr); break; } + if (wpa_s->ap_iface) { + wpa_dbg(wpa_s, MSG_DEBUG, "Ignore deauth event in " + "AP mode"); + break; + } #endif /* CONFIG_AP */ wpa_supplicant_event_disassoc(wpa_s, reason_code); break;