@@ -2773,6 +2773,16 @@ static void p2p_sd_cb(struct p2p_data *p2p, int success)
p2p_dbg(p2p, "No SD peer entry known");
p2p_continue_find(p2p);
return;
+ } else if (p2p->sd_query->for_all_peers) {
+ /* Update the pending broadcast SD query count for this device */
+ p2p->sd_peer->sd_pending_bcast_queries--;
+
+ /*
+ * If there are no pending broadcast queries for this device, mark it as
+ * done (-1).
+ */
+ if (p2p->sd_peer->sd_pending_bcast_queries == 0)
+ p2p->sd_peer->sd_pending_bcast_queries = -1;
}
/* Wait for response from the peer */
@@ -301,16 +301,6 @@ int p2p_start_sd(struct p2p_data *p2p, struct p2p_device *dev)
ret = -1;
}
- /* Update the pending broadcast SD query count for this device */
- dev->sd_pending_bcast_queries--;
-
- /*
- * If there are no pending broadcast queries for this device, mark it as
- * done (-1).
- */
- if (dev->sd_pending_bcast_queries == 0)
- dev->sd_pending_bcast_queries = -1;
-
wpabuf_free(req);
return ret;
The sd_pending_bcast_queries variable should be decremented only in case of success. This way, the supplicant can retry if a service discovery request fails. Change-Id: Id2061f31e7f4669527d11cb3478a12af4418e1b9 Signed-off-by: Constantin Musca <constantin.musca@intel.com> --- src/p2p/p2p.c | 10 ++++++++++ src/p2p/p2p_sd.c | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-)