From patchwork Wed Jun 25 14:41:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peer, Ilan" X-Patchwork-Id: 364064 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 95C7414009B for ; Thu, 26 Jun 2014 01:43:50 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C25DC9D300; Wed, 25 Jun 2014 11:43:33 -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 zi9dg0rgFmKr; Wed, 25 Jun 2014 11:43:33 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A601C9D301; Wed, 25 Jun 2014 11:42:51 -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 C83E69D2E8 for ; Wed, 25 Jun 2014 11:42:48 -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 SyRfIWP3HTxV for ; Wed, 25 Jun 2014 11:42:42 -0400 (EDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 3A2B217C007 for ; Wed, 25 Jun 2014 11:42:36 -0400 (EDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 25 Jun 2014 08:32:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,546,1400050800"; d="scan'208";a="533984295" Received: from unknown (HELO ipeer-e6430-1.jer.intel.com) ([10.12.217.176]) by orsmga001.jf.intel.com with ESMTP; 25 Jun 2014 08:37:33 -0700 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH 4/5] TDLS: abort local setup when failing to add STA Date: Wed, 25 Jun 2014 17:41:54 +0300 Message-Id: <1403707315-17613-4-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1403707315-17613-1-git-send-email-ilan.peer@intel.com> References: <1403707315-17613-1-git-send-email-ilan.peer@intel.com> Cc: Arik Nemtsov , Arik Nemtsov 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 From: Arik Nemtsov The driver might not always be able to add the new station. Abort the setup when this happens. Signed-off-by: Arik Nemtsov --- src/rsn_supp/tdls.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c index f86d29c..f307ff1 100644 --- a/src/rsn_supp/tdls.c +++ b/src/rsn_supp/tdls.c @@ -2531,8 +2531,11 @@ int wpa_tdls_start(struct wpa_sm *sm, const u8 *addr) peer->initiator = 1; /* add the peer to the driver as a "setup in progress" peer */ - wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, 0, NULL, 0, NULL, NULL, 0, - NULL, 0, NULL, 0, NULL, 0); + if (wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, 0, NULL, 0, NULL, + NULL, 0, NULL, 0, NULL, 0, NULL, 0)) { + wpa_tdls_disable_peer_link(sm, peer); + return -1; + } peer->tpk_in_progress = 1;