]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Remove unexpected pending Provision Discovery Request in Search
authorJean-Michel.Bachot <jean-michelx.bachot@intel.com>
Sun, 11 Dec 2011 15:43:17 +0000 (17:43 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Dec 2011 15:43:17 +0000 (17:43 +0200)
A Pending Provision Discovery Request was sent in SEARCH phase after a
previous provision discovery timeout. Fix this by resetting the config
method of P2P device in the pending PD reset function. This avoids the
sending of a pending Provision Discovery Request during the next P2P
search.

Signed-off-by: Jean-Michel.Bachot <jean-michelx.bachot@intel.com>
src/p2p/p2p_pd.c

index 759d108022d793294bc04cc0d944a510032f8258..64094546add340644e3c45bca90815509129cede 100644 (file)
@@ -391,6 +391,20 @@ int p2p_prov_disc_req(struct p2p_data *p2p, const u8 *peer_addr,
 
 void p2p_reset_pending_pd(struct p2p_data *p2p)
 {
+       struct p2p_device *dev;
+
+       dl_list_for_each(dev, &p2p->devices, struct p2p_device, list) {
+               if (os_memcmp(p2p->pending_pd_devaddr,
+                             dev->info.p2p_device_addr, ETH_ALEN))
+                       continue;
+               if (!dev->req_config_methods)
+                       continue;
+               if (dev->flags & P2P_DEV_PD_FOR_JOIN)
+                       continue;
+               /* Reset the config methods of the device */
+               dev->req_config_methods = 0;
+       }
+
        p2p->user_initiated_pd = 0;
        os_memset(p2p->pending_pd_devaddr, 0, ETH_ALEN);
        p2p->pd_retries = 0;