[PATCH] P2P: Include passive channels in invitation response

Mikael Kanstrup mikael.kanstrup
Fri Oct 17 06:03:21 PDT 2014


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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-P2P-Include-passive-channels-in-invitation-response.patch
Type: text/x-patch
Size: 2116 bytes
Desc: not available
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20141017/a9450e77/attachment.bin>



More information about the Hostap mailing list