[PATCH 16/23] P2PS: Re-select channel on PD response processing

Ilan Peer ilan.peer at intel.com
Thu Sep 24 13:38:06 EDT 2015


It is possible that the initial operating channel is not
supported by the peer, so reselect the channel from the
channel intersection.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/p2p/p2p_pd.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index 9ec1d70..8532a26 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -1408,10 +1408,19 @@ void p2p_process_prov_disc_resp(struct p2p_data *p2p, const u8 *sa,
 
 		if (p2p->cfg->p2ps_prov_complete) {
 			int freq = 0;
+			u8 tmp;
 
-			if (conncap == P2PS_SETUP_GROUP_OWNER)
+			if (conncap == P2PS_SETUP_GROUP_OWNER) {
+				/* Re-select the oprating channel as it is
+				 * possible that original channel is no longer
+				 * valid. This should not really fail
+				 */
+				if (p2p_go_select_channel(p2p, dev, &tmp) < 0)
+					p2p_dbg(p2p,
+						"P2PS PD channel selection failed");
 				freq = p2p_channel_to_freq(p2p->op_reg_class,
 							   p2p->op_channel);
+			}
 
 			p2p->cfg->p2ps_prov_complete(
 				p2p->cfg->cb_ctx, status, sa, adv_mac,
-- 
1.9.1



More information about the HostAP mailing list