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

Submitted by Jithu Jance on Oct. 31, 2011, 1:33 p.m.

Details

Message ID 6C370B347C3FE8438C9692873287D2E119560C6AFF@SJEXCHCCR01.corp.ad.broadcom.com
State Accepted
Commit 5cfda25e444b4144551d5320d3b1831339914439
Headers show

Commit Message

Jithu Jance Oct. 31, 2011, 1:33 p.m.
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@broadcom.com>

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

Comments

Jouni Malinen Nov. 18, 2011, 9:16 p.m.
On Mon, Oct 31, 2011 at 06:33:06AM -0700, Jithu Jance wrote:
> 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. 

Thanks! Applied.

Patch hide | download patch | download mbox

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)