[PATCH] Remove P2P Group Client virtual interface on getting a Deauth Event.

Jithu Jance jithu at broadcom.com
Mon Oct 31 06:08:34 EDT 2011


Hi Jouni,

Your suggestion of using "p2p_group_idle" seems to be more beneficial. This will allow the framework/upper application to decide whether the Group needs to be removed or not. For applications that wants to disconnect P2P client on deauth can set "p2p_group_idle". This will give more flexibility to the upper framework. Thanks for pointing this out. 

- Jithu Jance.

-----Original Message-----
From: hostap-bounces at lists.shmoo.com [mailto:hostap-bounces at lists.shmoo.com] On Behalf Of Jouni Malinen
Sent: Monday, October 31, 2011 1:17 AM
To: hostap at lists.shmoo.com
Subject: Re: [PATCH] Remove P2P Group Client virtual interface on getting a Deauth Event.

On Sun, Oct 30, 2011 at 11:11:32AM -0700, Jithu Jance wrote:
> This patch removes P2P Group Client virtual interface on getting a Deauth Event. Kindly
> see whether the patch is okay.

This is an area that I've had some problems in trying to make up my mind
on what would the best approach here. Normal wpa_supplicant behavior is
to try to reconnect to the network whenever an association is lost for
whatever reason. This different P2P behavior does not really sound very
consistent with it and it would have been quite a bit nicer if the GO
behavior for disconnecting a P2P client would have been more explicit by
using a P2P IE with explicit notification of client being kicked out
from the group..

It could be a bit safer to use the group idle mechanism instead of
removing the group immediately, i.e., allow some time (say, 15 seconds)
for wpa_supplicant to try to reconnect and if that does not go through,
remove the group at that point. This should be easily doable by
extending wpas_p2p_set_group_idle_timeout() to take in an argument
specifying that forced idle time and calling it from the deauth/disassoc
event rather than removing the group immediately.

> diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
> @@ -3717,6 +3717,21 @@ void wpas_p2p_deauth_notif(struct wpa_supplicant *wpa_s, const u8 *bssid,
> +void wpas_p2p_group_remove_notif(struct wpa_supplicant *wpa_s, u16 reason_code)
> +{
> +	if(wpa_s->global->p2p_disabled)
> +		return;
> +
> +	/* If we are running a P2P Client and we received a Deauth/Disassoc from the Go, then remove
> +	   the virutal interface on which the client is running. */
> +	if((wpa_s != wpa_s->parent) && (wpa_s->p2p_group_interface == P2P_GROUP_INTERFACE_CLIENT) && (wpa_s->key_mgmt != WPA_KEY_MGMT_WPS)) {

Why would this be limited to case of using a virtual group interface? I
would expect to see same behavior regardless of whether a separate
interface is used. The group idle handles this in consistent way.

In addition, there may not really be need for this new
wpas_p2p_group_remove_notif() since the existing
wpas_p2p_notif_disconnected() could already be enough. Actually, you may
get the desired functionality by just configuring p2p_group_idle=15
which means that the P2P client interface is automatically removed if
the GO has not been visible for 15 seconds.

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