[PATCH] P2P: Increment sd_pending_bcast_queries if Service Discovery fails

Musca, Constantin constantin.musca
Thu Sep 18 05:22:27 PDT 2014


Please disregard this patch and look at the reworked one:
[PATCH] P2P: Decrement sd_pending_bcast_queries when sd returns success

Thanks,
Constantin

-----Original Message-----
From: Musca, Constantin 
Sent: Wednesday, September 17, 2014 10:03 PM
To: hostap at lists.shmoo.com
Cc: Musca, Constantin
Subject: [PATCH] P2P: Increment sd_pending_bcast_queries if Service Discovery fails

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