Patchwork [1/1] P2P: Handle P2P de-init incase of supplicant termination

login
register
mail settings
Submitter Jithu Jance
Date Aug. 12, 2013, 5:22 a.m.
Message ID <20130812052246.GA15445@jithu@broadcom.com>
Download mbox | patch
Permalink /patch/266416/
State Rejected
Headers show

Comments

Jithu Jance - Aug. 12, 2013, 5:22 a.m.
This patch is for taking care of a case of supplicant
receiving a terminate signal while running an active p2p interface.
In this case, currently p2p de-initialization is not happening. This
code was there earlier and got removed recently.

Signed-hostap: Jithu Jance <jithu@broadcom.com>
---
 wpa_supplicant/wpa_supplicant.c |    2 ++
 1 file changed, 2 insertions(+)

--
1.7.9.5
Jouni Malinen - Aug. 25, 2013, 6:57 a.m.
On Mon, Aug 12, 2013 at 10:52:46AM +0530, Jithu Jance wrote:
> This patch is for taking care of a case of supplicant
> receiving a terminate signal while running an active p2p interface.
> In this case, currently p2p de-initialization is not happening. This
> code was there earlier and got removed recently.

How do you start wpa_supplicant in a case where this happens? I.e., what
kind of interfaces are initialized and in which order on the command
line? wpas_p2p_deinit_global() is now supposed to be called when the
interface that was used to initiate the global P2P context is removed.

> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> @@ -3444,6 +3444,8 @@ void wpa_supplicant_deinit(struct wpa_global *global)
>  	wifi_display_deinit(global);
>  #endif /* CONFIG_WIFI_DISPLAY */
> 
> +	wpas_p2p_deinit_global(global);
> +
>  	while (global->ifaces)
>  		wpa_supplicant_remove_iface(global, global->ifaces, 1);

And that call I mention above should happen from
wpa_supplicant_remove_iface().. If you are seeing a case where this does
not happen that could indicate that something else is broken and that
should be fixed instead of adding this extra call into
wpa_supplicant_deinit().

Patch

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index a18922a..630a545 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3444,6 +3444,8 @@  void wpa_supplicant_deinit(struct wpa_global *global)
 	wifi_display_deinit(global);
 #endif /* CONFIG_WIFI_DISPLAY */

+	wpas_p2p_deinit_global(global);
+
 	while (global->ifaces)
 		wpa_supplicant_remove_iface(global, global->ifaces, 1);