aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Musca <constantin.musca@intel.com>2014-09-22 15:00:37 +0300
committerLinux Build Service Account <lnxbuild@localhost>2014-11-04 08:24:44 -0700
commit933a5b3936f3b5c45739f7ee87abf15621457a30 (patch)
treecfcedb332b6361250dfc607f388035fbb96de7ac
parent75021f477289241cd18cff8fd9c4d77ad77d6eb2 (diff)
downloadandroid_external_wpa_supplicant_8-933a5b3936f3b5c45739f7ee87abf15621457a30.tar.gz
android_external_wpa_supplicant_8-933a5b3936f3b5c45739f7ee87abf15621457a30.tar.bz2
android_external_wpa_supplicant_8-933a5b3936f3b5c45739f7ee87abf15621457a30.zip
P2P: Decrement sd_pending_bcast_queries when sd returns success
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 CRs-fixed: 746126 Git-commit: 7139cf4a4f1fecfd03d0daff9bb33adb80cc3530 Git-repo : git://w1.fi/srv/git/hostap.git Signed-off-by: Constantin Musca <constantin.musca@intel.com> Change-Id: Ie131e2378cb976a5a4a24c1ae4f0ba26d2027351
-rw-r--r--src/p2p/p2p.c13
-rw-r--r--src/p2p/p2p_sd.c10
2 files changed, 13 insertions, 10 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 83d67156..9ee91476 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -2773,6 +2773,19 @@ static void p2p_sd_cb(struct p2p_data *p2p, int success)
return;
}
+ 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 */
p2p_set_state(p2p, P2P_SD_DURING_FIND);
p2p_set_timeout(p2p, 0, 200000);
diff --git a/src/p2p/p2p_sd.c b/src/p2p/p2p_sd.c
index 6235b1de..13119c20 100644
--- a/src/p2p/p2p_sd.c
+++ b/src/p2p/p2p_sd.c
@@ -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;