P2P: Use the same Dialog Token value for every PD retry
authorSunil Dutt <duttus@codeaurora.org>
Tue, 8 Jan 2013 11:12:34 +0000 (13:12 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 8 Jan 2013 11:12:34 +0000 (13:12 +0200)
Commit 175171ac6c3f2bb501897237d559de0fedfd992e ensured that the PD
requests are retried in join-a-running group case and the Enrollee is
started on either receiving the PD response or after the retries. Each
PD request is retried with an unique dialog token and a PD response from
the GO with a mismatched dialog token is ignored. Thus, the P2P client
would continue retrying the PD requests till the response with a
matching dialog token is obtained. This would result in the GO getting
multiple PD requests and a corresponding user notification (POP UP) in
implementations where each PD request results in a POP UP, resulting in
a bad user experience. To avoid such behavior, the same dialog token
value is used for every retry in the same PD exchange.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/p2p/p2p_pd.c

index d28efd1..ca33f17 100644 (file)
@@ -380,9 +380,6 @@ int p2p_send_prov_disc_req(struct p2p_data *p2p, struct p2p_device *dev,
                /* TODO: use device discoverability request through GO */
        }
 
-       dev->dialog_token++;
-       if (dev->dialog_token == 0)
-               dev->dialog_token = 1;
        req = p2p_build_prov_disc_req(p2p, dev->dialog_token,
                                      dev->req_config_methods,
                                      join ? dev : NULL);
@@ -453,6 +450,14 @@ int p2p_prov_disc_req(struct p2p_data *p2p, const u8 *peer_addr,
        if (p2p->user_initiated_pd)
                p2p->pd_retries = MAX_PROV_DISC_REQ_RETRIES;
 
+       /*
+        * Assign dialog token here to use the same value in each retry within
+        * the same PD exchange.
+        */
+       dev->dialog_token++;
+       if (dev->dialog_token == 0)
+               dev->dialog_token = 1;
+
        return p2p_send_prov_disc_req(p2p, dev, join, force_freq);
 }