]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix PD retry channel on join-a-group case
authorJouni Malinen <j@w1.fi>
Sun, 20 Oct 2013 15:06:15 +0000 (18:06 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 20 Oct 2013 18:38:02 +0000 (21:38 +0300)
Join-a-group needs to force the current operating channel of the target
group as the frequency to use for the PD exchange. When the channel was
selected based on a BSS entry for the GO, this worked only for the first
PD Request frame while the retries reverted to a potentially different
channel based on a P2P peer entry. Fix this by maintaining the forced
channel through the PD retry sequence.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/p2p/p2p.c
src/p2p/p2p_i.h
src/p2p/p2p_pd.c

index 178a8f6da92bb7163323c9ec52fe35debc83fc38..9b7744c00056f0bdd659b2ee39c34456405acd40 100644 (file)
@@ -2664,7 +2664,8 @@ static void p2p_retry_pd(struct p2p_data *p2p)
                        MAC2STR(dev->info.p2p_device_addr),
                        dev->req_config_methods);
                p2p_send_prov_disc_req(p2p, dev,
-                                      dev->flags & P2P_DEV_PD_FOR_JOIN, 0);
+                                      dev->flags & P2P_DEV_PD_FOR_JOIN,
+                                      p2p->pd_force_freq);
                return;
        }
 }
index 6e57f45a8c4a02a9ba25768d25c822d1d9f316fa..e12e6f0e6a24988388a7c47385bfe5e56613c58e 100644 (file)
@@ -442,6 +442,14 @@ struct p2p_data {
         */
        int pd_retries;
 
+       /**
+        * pd_force_freq - Forced frequency for PD retries or 0 to auto-select
+        *
+        * This is is used during PD retries for join-a-group case to use the
+        * correct operating frequency determined from a BSS entry for the GO.
+        */
+       int pd_force_freq;
+
        u8 go_timeout;
        u8 client_timeout;
 
index 54aa4282812d4e02e450f6a78ddafa6500ec72fe..409405fb26888bec2f7fa1405f0f75403590a913 100644 (file)
@@ -437,6 +437,7 @@ int p2p_prov_disc_req(struct p2p_data *p2p, const u8 *peer_addr,
        }
 
        p2p->user_initiated_pd = user_initiated_pd;
+       p2p->pd_force_freq = force_freq;
 
        if (p2p->user_initiated_pd)
                p2p->pd_retries = MAX_PROV_DISC_REQ_RETRIES;
@@ -472,4 +473,5 @@ void p2p_reset_pending_pd(struct p2p_data *p2p)
        p2p->user_initiated_pd = 0;
        os_memset(p2p->pending_pd_devaddr, 0, ETH_ALEN);
        p2p->pd_retries = 0;
+       p2p->pd_force_freq = 0;
 }