[PATCH] Move control interface cleanup after wpa_supplicant_cleanup()

Dmitry Shmidt dimitrysh
Wed Aug 3 11:03:49 PDT 2011


This is needed to be able to communicate through control interface
after wpa_supplicant_cleanup()

Signed-off-by: Dmitry Shmidt <dimitrysh at google.com>
---
 wpa_supplicant/wpa_supplicant.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 3f3e435..c93c4d2 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -382,16 +382,10 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
 		wpa_s->l2_br = NULL;
 	}
 
-	if (wpa_s->ctrl_iface) {
-		wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface);
-		wpa_s->ctrl_iface = NULL;
-	}
 	if (wpa_s->conf != NULL) {
 		struct wpa_ssid *ssid;
 		for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next)
 			wpas_notify_network_removed(wpa_s, ssid);
-		wpa_config_free(wpa_s->conf);
-		wpa_s->conf = NULL;
 	}
 
 	os_free(wpa_s->confname);
@@ -2303,11 +2297,21 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s,
 
 	wpa_supplicant_cleanup(wpa_s);
 
+	if (wpa_s->drv_priv)
+		wpa_drv_deinit(wpa_s);
+
 	if (notify)
 		wpas_notify_iface_removed(wpa_s);
 
-	if (wpa_s->drv_priv)
-		wpa_drv_deinit(wpa_s);
+	if (wpa_s->ctrl_iface) {
+		wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface);
+		wpa_s->ctrl_iface = NULL;
+	}
+
+	if (wpa_s->conf != NULL) {
+		wpa_config_free(wpa_s->conf);
+		wpa_s->conf = NULL;
+	}
 }
 
 
-- 
1.7.3.1




More information about the Hostap mailing list