From c45dabb8551a351d2fac9c7fc4c3df86cf0ff0d6 Mon Sep 17 00:00:00 2001 From: Eduardo Abinader Date: Wed, 20 Aug 2014 23:30:24 -0400 Subject: [PATCH] P2P: Deauth p2p client just after dbus notify Currently to signal PropertiesChanged upon group client removal (group property), wpa_supplicant dbus uses wpa_s members like go_dev_addr and current_ssid, for instance. Thus, deferring p2p client deauth to after dbus notify, but keeping the same order as before, solves the issue, as wpa_s is not yet completely deinitialized. Signed-off-by: Eduardo Abinader --- wpa_supplicant/p2p_supplicant.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index c77ae6afa..5d63de332 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -449,11 +449,16 @@ static int wpas_p2p_group_delete(struct wpa_supplicant *wpa_s, (ssid && ssid->mode == WPAS_MODE_INFRA)) { wpa_s->reassociate = 0; wpa_s->disconnected = 1; - wpa_supplicant_deauthenticate(wpa_s, - WLAN_REASON_DEAUTH_LEAVING); gtype = "client"; } else gtype = "GO"; + + if (removal_reason != P2P_GROUP_REMOVAL_SILENT && ssid) + wpas_notify_p2p_group_removed(wpa_s, ssid, gtype); + + if (os_strcmp(gtype, "client") == 0) + wpa_supplicant_deauthenticate(wpa_s, WLAN_REASON_DEAUTH_LEAVING); + if (wpa_s->cross_connect_in_use) { wpa_s->cross_connect_in_use = 0; wpa_msg_global(wpa_s->parent, MSG_INFO, @@ -511,9 +516,6 @@ static int wpas_p2p_group_delete(struct wpa_supplicant *wpa_s, */ wpa_s->global->p2p_go_wait_client.sec = 0; - if (removal_reason != P2P_GROUP_REMOVAL_SILENT && ssid) - wpas_notify_p2p_group_removed(wpa_s, ssid, gtype); - if (wpa_s->p2p_group_interface != NOT_P2P_GROUP_INTERFACE) { struct wpa_global *global; char *ifname;