diff mbox

P2P: Include passive channels in invitation response

Message ID CACZXzRCgZJYrv_2bSFmRkNkKwOwcd+4vAuM5-zphoLkQ5ifWrA@mail.gmail.com
State Accepted
Headers show

Commit Message

Mikael Kanstrup Oct. 17, 2014, 1:03 p.m. UTC
Patch 51e9f22809b0f412c9c10baa34ddc46cf5df4f33 added the option
p2p_add_cli_chan to allow P2P GC to connect on passive channels
assuming the GO should know whether allowed to send on these channels.
This patch adds missing cli_channels to invitation response messages
to allow re-connecting to a persistent group as GC on passive
channels.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
---
 src/p2p/p2p_invitation.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

  os_memset(group_bssid, 0, sizeof(group_bssid));
@@ -226,7 +226,10 @@ void p2p_process_invitation_req(struct p2p_data
*p2p, const u8 *sa,
  persistent = 1;
  }

- if (p2p_peer_channels_check(p2p, &p2p->cfg->channels, dev,
+ p2p_channels_union(&p2p->cfg->channels, &p2p->cfg->cli_channels,
+   &all_channels);
+
+ if (p2p_peer_channels_check(p2p, &all_channels, dev,
     msg.channel_list, msg.channel_list_len) <
     0) {
  p2p_dbg(p2p, "No common channels found");
@@ -236,7 +239,7 @@ void p2p_process_invitation_req(struct p2p_data
*p2p, const u8 *sa,

  p2p_channels_dump(p2p, "own channels", &p2p->cfg->channels);
  p2p_channels_dump(p2p, "peer channels", &dev->channels);
- p2p_channels_intersect(&p2p->cfg->channels, &dev->channels,
+ p2p_channels_intersect(&all_channels, &dev->channels,
        &intersection);
  p2p_channels_dump(p2p, "intersection", &intersection);

Comments

Jouni Malinen Oct. 18, 2014, 2:48 p.m. UTC | #1
On Fri, Oct 17, 2014 at 03:03:21PM +0200, Mikael Kanstrup wrote:
> Patch 51e9f22809b0f412c9c10baa34ddc46cf5df4f33 added the option
> p2p_add_cli_chan to allow P2P GC to connect on passive channels
> assuming the GO should know whether allowed to send on these channels.
> This patch adds missing cli_channels to invitation response messages
> to allow re-connecting to a persistent group as GC on passive
> channels.

Thanks, applied with some changes. The unmodified version resulted in
regressions to the cases where the Invitation Response frame is from the
device that becomes the GO since incorrect operating channel was
indicated in the message (one of those client-only channels). That broke
P2P Client side scan optimizations. I restored the previous behavior for
the case where the local end determines that it is the GO for the group.
diff mbox

Patch

From 63808d7ef49b163319c3a30a9f8ebe4ea399fd0e Mon Sep 17 00:00:00 2001
From: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
Date: Fri, 17 Oct 2014 13:16:35 +0200
Subject: [PATCH] P2P: Include passive channels in invitation response

Patch 51e9f22809b0f412c9c10baa34ddc46cf5df4f33 added the option
p2p_add_cli_chan to allow P2P GC to connect on passive channels
assuming the GO should know whether allowed to send on these channels.
This patch adds missing cli_channels to invitation response messages
to allow re-connecting to a persistent group as GC on passive
channels.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
---
 src/p2p/p2p_invitation.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c
index ef01a66..14597fe 100644
--- a/src/p2p/p2p_invitation.c
+++ b/src/p2p/p2p_invitation.c
@@ -174,7 +174,7 @@  void p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa,
 	u8 group_bssid[ETH_ALEN], *bssid;
 	int op_freq = 0;
 	u8 reg_class = 0, channel = 0;
-	struct p2p_channels intersection, *channels = NULL;
+	struct p2p_channels all_channels, intersection, *channels = NULL;
 	int persistent;
 
 	os_memset(group_bssid, 0, sizeof(group_bssid));
@@ -226,7 +226,10 @@  void p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa,
 		persistent = 1;
 	}
 
-	if (p2p_peer_channels_check(p2p, &p2p->cfg->channels, dev,
+	p2p_channels_union(&p2p->cfg->channels, &p2p->cfg->cli_channels,
+			   &all_channels);
+
+	if (p2p_peer_channels_check(p2p, &all_channels, dev,
 				    msg.channel_list, msg.channel_list_len) <
 	    0) {
 		p2p_dbg(p2p, "No common channels found");
@@ -236,7 +239,7 @@  void p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa,
 
 	p2p_channels_dump(p2p, "own channels", &p2p->cfg->channels);
 	p2p_channels_dump(p2p, "peer channels", &dev->channels);
-	p2p_channels_intersect(&p2p->cfg->channels, &dev->channels,
+	p2p_channels_intersect(&all_channels, &dev->channels,
 			       &intersection);
 	p2p_channels_dump(p2p, "intersection", &intersection);
 
-- 
1.8.2.2