[PATCH] If P2P device expires while GO nego is in progress, indicate GO Nego failure.

Jithu Jance jithu at broadcom.com
Wed Nov 2 13:25:19 EDT 2011


Hi Jouni,

This patch addresses a corner case in GO-Negotiation case. Consider the scenario where two devices A and B are in discovery stage and Device B vanishes [moves out of range] when a connect is issued on the Device A. Then Device A keeps on retrying the GO Nego req till the retry limit is reached. On reaching retry limit, the pending group interface is removed. But suppose if the peer entry in the device list expires before the retry limit is reached, then pending group interface is not removed.
 
This patch will indicate go nego failure and will remove any pending group interfaces. Kindly see whether the patch is okay.

________________________________________
From: hostap-bounces at lists.shmoo.com [hostap-bounces at lists.shmoo.com] On Behalf Of Jithu Jance [jithu at broadcom.com]
Sent: Monday, October 31, 2011 7:03 PM
To: hostap at lists.shmoo.com
Subject: [PATCH] If P2P device expires while GO nego is in progress, indicate GO Nego failure.

If P2P device expires while a GO negotiation is in progress, currently p2p->go_neg_peer is cleared without indicating GO Nego failure.
This will result in pending group interfaces to be left over. This patch will indicate go nego failure and will remove any pending
group interfaces.


Signed-off-by: Jithu Jance <jithu at broadcom.com>

---
 src/p2p/p2p.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 404b2cd..5a7aee2 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -625,8 +625,12 @@ static void p2p_device_free(struct p2p_data *p2p, struct p2p_device *dev)
 {
        int i;

-       if (p2p->go_neg_peer == dev)
+       if (p2p->go_neg_peer == dev) {
+               /* If GO Negotiation is in progress, report that
+                * it has failed. */
+               p2p_go_neg_failed(p2p, dev, -1);
                p2p->go_neg_peer = NULL;
+       }
        if (p2p->invite_peer == dev)
                p2p->invite_peer = NULL;
        if (p2p->sd_peer == dev)
--
1.7.4.1


- Jithu Jance.
_______________________________________________
HostAP mailing list
HostAP at lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap




More information about the HostAP mailing list