[PATCH] Move control interface cleanup after wpa_supplicant_cleanup()

Jouni Malinen j
Sat Aug 6 11:49:29 PDT 2011


On Wed, Aug 03, 2011 at 11:03:49AM -0700, Dmitry Shmidt wrote:
> This is needed to be able to communicate through control interface
> after wpa_supplicant_cleanup()

What communication is there after that? You mentioned
wpas_notify_iface_removed(), but there does not seem to be any
wpa_msg*() calls there..

> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> index 3f3e435..c93c4d2 100644
> @@ -382,16 +382,10 @@ static void wpa_supplicant_cleanup(struct wpa_supplicant *wpa_s)
>  	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;
>  	}

This is a bit ugly leaving partially cleared configuration behind..

> @@ -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);

Why not just move wpa_supplicant_cleanup() call to be after the
wpas_notify_iface_removed()? Why was wpa_drv_deinit() moved to be before
wpas_notify_iface_removed()?

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list