[PATCH] Move control interface cleanup after wpa_supplicant_cleanup()

Dmitry Shmidt dimitrysh
Mon Aug 8 09:28:03 PDT 2011


Hi,

On Sat, Aug 6, 2011 at 11:49 AM, Jouni Malinen <j at w1.fi> wrote:
> 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..

It will be different patch - we want to add wpa_msg() - we just didn't
agree yet about
what will be the commonly accepted message. And it can be done in
different patch.

>
>> 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..

Agree 100%, just wanted to minimize the changes. Let me know if this
is the only concern, I'll move
it.

>
>> @@ -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()?

Notification is sent to Wifi manager. If it is done before real
deinit() Wifi manager may start to do
things "in parallel" with wpa_supplicant to the interface. (In our
case it started hostapd() that sometimes got
unexpected interface down).

>
> --
> Jouni Malinen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>



More information about the Hostap mailing list