[PATCH] P2P: Increment sd_pending_bcast_queries if Service Discovery fails

Constantin Musca constantin.musca at intel.com
Wed Sep 17 15:02:41 EDT 2014


If the Service Discovery Query TX callback returns an unsuccessful
status increment the sd_peer pending_bcast_queries variable to
resend the Service Discovery request.

Signed-off-by: Constantin Musca <constantin.musca at intel.com>
---
 src/p2p/p2p.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index e746310..7aea86d 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -2764,6 +2764,10 @@ static void p2p_sd_cb(struct p2p_data *p2p, int success)
 	p2p->pending_action_state = P2P_NO_PENDING_ACTION;
 
 	if (!success) {
+		if (p2p->sd_peer->sd_pending_bcast_queries == -1) {
+			p2p->sd_peer->sd_pending_bcast_queries = 0;
+		}
+		p2p->sd_peer->sd_pending_bcast_queries++;
 		p2p->sd_peer = NULL;
 		p2p_continue_find(p2p);
 		return;
-- 
1.9.1



More information about the HostAP mailing list