diff mbox

[3/6] P2P: Set p2p_go_wait_client in invitation_result() cb

Message ID 1446560701-30841-4-git-send-email-ilan.peer@intel.com
State Changes Requested
Headers show

Commit Message

Peer, Ilan Nov. 3, 2015, 2:24 p.m. UTC
When an invitation to join an existing group is accepted by the
peer device, set p2p_go_wait_client to the current time so
that wpas_p2p_in_progress() would return != 0, thus preventing
P2P CSA, scanning etc., that would interfere with the peer
device connection.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 wpa_supplicant/p2p_supplicant.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Jouni Malinen Nov. 21, 2015, 4:28 p.m. UTC | #1
On Tue, Nov 03, 2015 at 04:24:58PM +0200, Ilan Peer wrote:
> When an invitation to join an existing group is accepted by the
> peer device, set p2p_go_wait_client to the current time so
> that wpas_p2p_in_progress() would return != 0, thus preventing
> P2P CSA, scanning etc., that would interfere with the peer
> device connection.

> diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
> @@ -3101,7 +3101,13 @@ static void wpas_invitation_result(void *ctx, int status, const u8 *bssid,
>  	if (wpa_s->pending_invite_ssid_id == -1) {
>  		if (status == P2P_SC_FAIL_UNKNOWN_GROUP)
>  			wpas_remove_persistent_client(wpa_s, peer);
> -		return; /* Invitation to active group */
> +
> +		/*
> +		 * Invitation to active group. Set the client wait, to allow
> +		 * provisioning and connection.
> +		 */
> +		os_get_reltime(&wpa_s->global->p2p_go_wait_client);
> +		return;
>  	}

Shouldn't this check for status == P2P_SC_SUCCESS to match that comment
about accepted invitation in the commit message? In addition to that,
this looks a bit confusing since this location can be reached both in GO
and P2P Client role in an existing group. I'd understand the GO case,
but setting p2p_go_wait_client on an interface that is in P2P Client
role would make this more difficult to understand.
Peer, Ilan Nov. 22, 2015, 8:55 a.m. UTC | #2
> -----Original Message-----
> From: Jouni Malinen [mailto:j@w1.fi]
> Sent: Saturday, November 21, 2015 18:29
> To: Peer, Ilan
> Cc: hostap@lists.infradead.org
> Subject: Re: [PATCH 3/6] P2P: Set p2p_go_wait_client in invitation_result() cb
> 
> On Tue, Nov 03, 2015 at 04:24:58PM +0200, Ilan Peer wrote:
> > When an invitation to join an existing group is accepted by the peer
> > device, set p2p_go_wait_client to the current time so that
> > wpas_p2p_in_progress() would return != 0, thus preventing P2P CSA,
> > scanning etc., that would interfere with the peer device connection.
> 
> > diff --git a/wpa_supplicant/p2p_supplicant.c
> > b/wpa_supplicant/p2p_supplicant.c @@ -3101,7 +3101,13 @@ static void
> wpas_invitation_result(void *ctx, int status, const u8 *bssid,
> >  	if (wpa_s->pending_invite_ssid_id == -1) {
> >  		if (status == P2P_SC_FAIL_UNKNOWN_GROUP)
> >  			wpas_remove_persistent_client(wpa_s, peer);
> > -		return; /* Invitation to active group */
> > +
> > +		/*
> > +		 * Invitation to active group. Set the client wait, to allow
> > +		 * provisioning and connection.
> > +		 */
> > +		os_get_reltime(&wpa_s->global->p2p_go_wait_client);
> > +		return;
> >  	}
> 
> Shouldn't this check for status == P2P_SC_SUCCESS to match that comment
> about accepted invitation in the commit message? In addition to that, this
> looks a bit confusing since this location can be reached both in GO and P2P
> Client role in an existing group. I'd understand the GO case, but setting
> p2p_go_wait_client on an interface that is in P2P Client role would make this
> more difficult to understand.
> 

Yes. Will fix.

Thanks,

Ilan.
diff mbox

Patch

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 7d78623..59ca368 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -3101,7 +3101,13 @@  static void wpas_invitation_result(void *ctx, int status, const u8 *bssid,
 	if (wpa_s->pending_invite_ssid_id == -1) {
 		if (status == P2P_SC_FAIL_UNKNOWN_GROUP)
 			wpas_remove_persistent_client(wpa_s, peer);
-		return; /* Invitation to active group */
+
+		/*
+		 * Invitation to active group. Set the client wait, to allow
+		 * provisioning and connection.
+		 */
+		os_get_reltime(&wpa_s->global->p2p_go_wait_client);
+		return;
 	}
 
 	if (status == P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE) {