From patchwork Mon Nov 7 16:44:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 124132 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 086EBB6F7F for ; Tue, 8 Nov 2011 03:45:17 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 055889C1A5; Mon, 7 Nov 2011 11:45:14 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4O6sfhxCy+Yg; Mon, 7 Nov 2011 11:45:13 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 039409C1A7; Mon, 7 Nov 2011 11:45:10 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id ADE129C1A7 for ; Mon, 7 Nov 2011 11:45:08 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XumbeCnPcKuU for ; Mon, 7 Nov 2011 11:45:03 -0500 (EST) Received: from mms1.broadcom.com (mms1.broadcom.com [216.31.210.17]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2C99C9C1A5 for ; Mon, 7 Nov 2011 11:44:59 -0500 (EST) Received: from [10.16.192.224] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Mon, 07 Nov 2011 08:52:29 -0800 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from SJEXCHCCR01.corp.ad.broadcom.com ([10.252.49.130]) by SJEXCHHUB01.corp.ad.broadcom.com ([10.16.192.224]) with mapi; Mon, 7 Nov 2011 08:44:49 -0800 From: "Jithu Jance" To: "hostap@lists.shmoo.com" Date: Mon, 7 Nov 2011 08:44:48 -0800 Subject: [PATCH] If P2P device expires while GO nego is in progress, indicate GO Nego failure. Thread-Topic: [PATCH] If P2P device expires while GO nego is in progress, indicate GO Nego failure. Thread-Index: AQHMl9GfNiOp37IYTUK3CfVShmO8BZWZ2SY1gAcJ3OA= Message-ID: <0BED5F74AB839C4796CA2BFC2BC311B4103EF007B9@SJEXCHCCR01.corp.ad.broadcom.com> References: <6C370B347C3FE8438C9692873287D2E119560C6AFF@SJEXCHCCR01.corp.ad.broadcom.com> <6C370B347C3FE8438C9692873287D2E119560C6B02@SJEXCHCCR01.corp.ad.broadcom.com> In-Reply-To: <6C370B347C3FE8438C9692873287D2E119560C6B02@SJEXCHCCR01.corp.ad.broadcom.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-WSS-ID: 62A6D3473JW15014061-01-01 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Sorry to resend the patch again. Kindly let me know, if the patch is not proper or doesn't address the below mentioned scenario as intended. 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. Signed-hostap: Jithu Jance --- src/p2p/p2p.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) -- 1.7.4.1 -- Jithu Jance. 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)