aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRashmi Ramanna <c_ramanr@qti.qualcomm.com>2014-11-26 21:23:55 +0530
committerRashmi Ramanna <rashmi@codeaurora.org>2014-12-01 13:41:56 +0530
commit5331659e57c7aab29f85c30ba7378f2430473ad7 (patch)
treea64df3032ae83fa879eda1bb8de2baff6a930bd4
parent39e5f85eff7fb93165f8a8a157c4ed64c39b0db8 (diff)
downloadandroid_external_wpa_supplicant_8-5331659e57c7aab29f85c30ba7378f2430473ad7.tar.gz
android_external_wpa_supplicant_8-5331659e57c7aab29f85c30ba7378f2430473ad7.tar.bz2
android_external_wpa_supplicant_8-5331659e57c7aab29f85c30ba7378f2430473ad7.zip
P2P: Reinvite with social operation channel if no common channels
If invitation to reinvoke a persistent group from the GO fails with the peer indicating that there are no common channels, there is no defined means for the peer to indicate which channel could have worked. Since this type of issue with available channels changing over time can happen, try to work around this by retrying invitation using one of the social channels as the operating channel unless a specific operating channel was forced for the group. CRs-fixed: 764464 Git-commit: ac330cfd87397a1a01e697984f3944f427e88dad Git-repo : git://w1.fi/srv/git/hostap.git Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Change-Id: I40106f91e0e7bc3b2dfddcac75c7034a34773e95
-rw-r--r--src/p2p/p2p_i.h2
-rw-r--r--src/p2p/p2p_invitation.c18
2 files changed, 20 insertions, 0 deletions
diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h
index 19f4a803..11359316 100644
--- a/src/p2p/p2p_i.h
+++ b/src/p2p/p2p_i.h
@@ -269,6 +269,8 @@ struct p2p_data {
u8 invite_go_dev_addr_buf[ETH_ALEN];
int invite_dev_pw_id;
+ unsigned int retry_invite_req;
+
/**
* sd_peer - Pointer to Service Discovery peer
*/
diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c
index ef01a668..cfd95ab1 100644
--- a/src/p2p/p2p_invitation.c
+++ b/src/p2p/p2p_invitation.c
@@ -431,6 +431,22 @@ void p2p_process_invitation_resp(struct p2p_data *p2p, const u8 *sa,
return;
}
+ if (*msg.status == P2P_SC_FAIL_NO_COMMON_CHANNELS &&
+ p2p->retry_invite_req &&
+ p2p_channel_random_social(&p2p->cfg->channels, &p2p->op_reg_class,
+ &p2p->op_channel) == 0) {
+ p2p->retry_invite_req = 0;
+ p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p_set_state(p2p, P2P_INVITE);
+ p2p_dbg(p2p, "Resend Invitation Request setting op_class %u channel %u as operating channel",
+ p2p->op_reg_class, p2p->op_channel);
+ p2p_invite_send(p2p, p2p->invite_peer, p2p->invite_go_dev_addr,
+ p2p->invite_dev_pw_id);
+ p2p_parse_free(&msg);
+ return;
+ }
+ p2p->retry_invite_req = 0;
+
if (!msg.channel_list && *msg.status == P2P_SC_SUCCESS) {
p2p_dbg(p2p, "Mandatory Channel List attribute missing in Invitation Response from "
MACSTR, MAC2STR(sa));
@@ -592,6 +608,8 @@ int p2p_invite(struct p2p_data *p2p, const u8 *peer, enum p2p_invite_role role,
dev_pw_id);
}
p2p->invite_dev_pw_id = dev_pw_id;
+ p2p->retry_invite_req = role == P2P_INVITE_ROLE_GO &&
+ persistent_group && !force_freq;
dev = p2p_get_device(p2p, peer);
if (dev == NULL || (dev->listen_freq <= 0 && dev->oper_freq <= 0 &&