From patchwork Wed Aug 7 10:08:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peer, Ilan" X-Patchwork-Id: 265474 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]) by ozlabs.org (Postfix) with ESMTP id 5F8D82C0221 for ; Wed, 7 Aug 2013 21:08:05 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 3312317C066; Wed, 7 Aug 2013 07:08: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 3hXDLaqRGB4K; Wed, 7 Aug 2013 07:07:59 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 7BDC29D3FD; Wed, 7 Aug 2013 07:07:15 -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 3991C9D3E2 for ; Wed, 7 Aug 2013 07:07:13 -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 PM-ozGbsXkev for ; Wed, 7 Aug 2013 07:07:08 -0400 (EDT) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 5697517C06D for ; Wed, 7 Aug 2013 07:06:48 -0400 (EDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 07 Aug 2013 04:06:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,832,1367996400"; d="scan'208";a="377424455" Received: from ipeer-e6430-1.jer.intel.com ([10.12.217.166]) by fmsmga001.fm.intel.com with ESMTP; 07 Aug 2013 04:06:44 -0700 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH] P2P: Skip non p2p interface in p2p_group_remove * Date: Wed, 7 Aug 2013 13:08:42 +0300 Message-Id: <1375870125-27991-6-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1375870125-27991-1-git-send-email-ilan.peer@intel.com> References: <1375870125-27991-1-git-send-email-ilan.peer@intel.com> 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: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com When 'p2p_group_remove *' is called while the station interface is connected, the flow also disconnects the station interface. Fix this by skipping non P2P interfaces in the iteration. Signed-hostap: Ilan Peer --- wpa_supplicant/p2p_supplicant.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 2c363ec..06d331b 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -4132,7 +4132,10 @@ int wpas_p2p_group_remove(struct wpa_supplicant *wpa_s, const char *ifname) while (wpa_s) { prev = wpa_s; wpa_s = wpa_s->next; - wpas_p2p_disconnect(prev); + if (prev->p2p_group_interface != + NOT_P2P_GROUP_INTERFACE) { + wpas_p2p_disconnect(prev); + } } return 0; }