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

Jouni Malinen j
Sun Oct 30 12:47:02 PDT 2011

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

More information about the Hostap mailing list