From patchwork Wed Apr 3 15:17:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1075787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h3R1hV/n"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Z3d26j5Nz9sS3 for ; Wed, 3 Apr 2019 22:24:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cArqwUwklKqxKVQekix77hjkgzPIpsFN3Qj6N9hUASY=; b=h3R1hV/nMXKiyH /z1BYQFgi86aPJTvzrBoFT7sO0D/7Hjt8Rgza4CER0n/PHjdxps5ST0KJLaJuiL4XT1dsbQET2bYl dBXy391WyC0kpO6V6DxBCeNDL4Ti+4o7hsto7y4TSJMwq3bHstqd/5rmNosbKLinnxsqeoJ8FV9xP mnot4skx9RxOXG/2DyCHhpm9UfYBTCiPh8z4jLsv58M5kf3R1dSQLDfWZ2Q/wJ8+3UYwp9QX7wYMH +R1I86mZoRl2wWhcP6RITLbY9xm0FSB9iVFsSfcwBBECLwsaeo0vxkoUMqzxXH7tHziAzlCAx1kg8 KWeUBpC+1uDKRMWzmINA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBe0B-0005NE-Re; Wed, 03 Apr 2019 11:24:19 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBdzw-0004zZ-M2 for hostap@lists.infradead.org; Wed, 03 Apr 2019 11:24:07 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2019 04:24:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,304,1549958400"; d="scan'208";a="128260524" Received: from andrei-xps-12-9q33.jer.intel.com ([10.12.190.129]) by orsmga007.jf.intel.com with ESMTP; 03 Apr 2019 04:24:03 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Subject: [PATCH] wpa_supplicant: Stop SA query on disconnection Date: Wed, 3 Apr 2019 18:17:14 +0300 Message-Id: <20190403151719.12165-4-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190403151719.12165-1-andrei.otcheretianski@intel.com> References: <20190403151719.12165-1-andrei.otcheretianski@intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_042405_052395_1966E2A1 X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.55.52.115 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrei Otcheretianski Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org SA query wasn't stopped after disconnection, which could potentially result in an unexpected SA timeout firing later when already connected to another AP. Fix that, by stopping SA query when disconnected. While at it, remove FT ies clearing from sme_deinit() as it is done twice. Signed-off-by: Andrei Otcheretianski --- wpa_supplicant/sme.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index b0fb62bb0e..c3afe90ca9 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -1984,17 +1984,14 @@ void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s) if (wpa_s->sme.ft_ies || wpa_s->sme.ft_used) sme_update_ft_ies(wpa_s, NULL, NULL, 0); #endif /* CONFIG_IEEE80211R */ +#ifdef CONFIG_IEEE80211W + sme_stop_sa_query(wpa_s); +#endif /* CONFIG_IEEE80211W */ } void sme_deinit(struct wpa_supplicant *wpa_s) { - os_free(wpa_s->sme.ft_ies); - wpa_s->sme.ft_ies = NULL; - wpa_s->sme.ft_ies_len = 0; -#ifdef CONFIG_IEEE80211W - sme_stop_sa_query(wpa_s); -#endif /* CONFIG_IEEE80211W */ sme_clear_on_disassoc(wpa_s); eloop_cancel_timeout(sme_assoc_timer, wpa_s, NULL);