From patchwork Thu May 30 03:09:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 247446 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 AA6A52C007B for ; Thu, 30 May 2013 13:10:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 249719C12B; Wed, 29 May 2013 23:10:06 -0400 (EDT) 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 GoZVQXnmCCSB; Wed, 29 May 2013 23:10:05 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 5533E9C11E; Wed, 29 May 2013 23:10:01 -0400 (EDT) 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 24ED99C11E for ; Wed, 29 May 2013 23:10:00 -0400 (EDT) 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 cqXltsGQ6QIa for ; Wed, 29 May 2013 23:09:55 -0400 (EDT) Received: from mms3.broadcom.com (mms3.broadcom.com [216.31.210.19]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E6CF19C11D for ; Wed, 29 May 2013 23:09:54 -0400 (EDT) Received: from [10.9.208.55] by mms3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Wed, 29 May 2013 20:01:03 -0700 X-Server-Uuid: B86B6450-0931-4310-942E-F00ED04CA7AF Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS07.corp.ad.broadcom.com (10.9.208.55) with Microsoft SMTP Server (TLS) id 14.1.438.0; Wed, 29 May 2013 20:09:50 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.1.438.0; Wed, 29 May 2013 20:09:49 -0700 Received: from [10.132.24.37] (lbblr-jithu01.ban.broadcom.com [10.132.24.37]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id E68EAF2D72; Wed, 29 May 2013 20:09:48 -0700 (PDT) Message-ID: <1369883387.2580.38.camel@lbblr-jithu01.broadcom.com> Subject: Re: [PATCH v3] P2P: Ignore the DEAUTH event from cfg80211 incase of locally generated disconnect From: "jithu Jance" To: "Jouni Malinen" Date: Thu, 30 May 2013 08:39:47 +0530 In-Reply-To: <20130529213838.GA11969@w1.fi> References: <1369748463.13596.19.camel@lbblr-jithu01.broadcom.com> <20130528213341.GA20944@w1.fi> <1369832304.2580.33.camel@lbblr-jithu01.broadcom.com> <20130529213838.GA11969@w1.fi> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-WSS-ID: 7DB81F652L824678567-01-01 Cc: hostap X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 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 Hi Jouni, Thanks for your suggestions. I have made the changes accordingly. Please find the patch below. Signed-hostap: Jithu Jance --- src/drivers/driver_nl80211.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) @@ -4905,8 +4908,14 @@ static int wpa_driver_nl80211_deauthenticate(struct i802_bss *bss, const u8 *addr, int reason_code) { struct wpa_driver_nl80211_data *drv = bss->drv; - if (!(drv->capa.flags & WPA_DRIVER_FLAGS_SME)) + if (!(drv->capa.flags & WPA_DRIVER_FLAGS_SME)) { + /* + * For locally generated disconnect, supplicant already + * generates a DEAUTH event. So ignore the event from NL80211. + */ + drv->ignore_next_local_disconnect = 1; return wpa_driver_nl80211_disconnect(drv, reason_code); + } wpa_printf(MSG_DEBUG, "%s(addr=" MACSTR " reason_code=%d)", __func__, MAC2STR(addr), reason_code); nl80211_mark_disconnected(drv); diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index f403189..4f7d7e3 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4892,12 +4892,15 @@ nla_put_failure: static int wpa_driver_nl80211_disconnect(struct wpa_driver_nl80211_data *drv, int reason_code) { + int ret; + wpa_printf(MSG_DEBUG, "%s(reason_code=%d)", __func__, reason_code); nl80211_mark_disconnected(drv); - drv->ignore_next_local_disconnect = 0; /* Disconnect command doesn't need BSSID - it uses cached value */ - return wpa_driver_nl80211_mlme(drv, NULL, NL80211_CMD_DISCONNECT, + ret = wpa_driver_nl80211_mlme(drv, NULL, NL80211_CMD_DISCONNECT, reason_code, 0); + if (ret) + drv->ignore_next_local_disconnect = 0; }