From patchwork Wed Jun 25 14:41:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilan Peer X-Patchwork-Id: 364065 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 ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D90271400B5 for ; Thu, 26 Jun 2014 01:44:04 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 1B84C9D308; Wed, 25 Jun 2014 11:43:42 -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 B-O1K7BlIVm6; Wed, 25 Jun 2014 11:43:41 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4A9FF17C018; Wed, 25 Jun 2014 11:42:56 -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 108A99D310 for ; Wed, 25 Jun 2014 11:42:55 -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 mLpkSGcBysVd for ; Wed, 25 Jun 2014 11:42:48 -0400 (EDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id AD7CC17C014 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:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,546,1400050800"; d="scan'208";a="533984339" 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:35 -0700 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH 5/5] TDLS: teardown connection on malformed setup-confirm Date: Wed, 25 Jun 2014 17:41:55 +0300 Message-Id: <1403707315-17613-5-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 Otherwise the peer will erroneously assume we have a working direct link. Signed-off-by: Arik Nemtsov --- src/rsn_supp/tdls.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c index f307ff1..1cd7e1e 100644 --- a/src/rsn_supp/tdls.c +++ b/src/rsn_supp/tdls.c @@ -2461,14 +2461,12 @@ skip_rsn: ret = wpa_tdls_enable_link(sm, peer); if (ret < 0) { wpa_printf(MSG_DEBUG, "TDLS: Could not enable link"); - wpa_tdls_do_teardown( - sm, peer, - WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED); + goto error; } } return ret; error: - wpa_tdls_disable_peer_link(sm, peer); + wpa_tdls_do_teardown(sm, peer, WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED); return -1; }