From patchwork Sat Nov 7 10:32:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: xing wan <18071720608@163.com> X-Patchwork-Id: 1396101 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.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=163.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=u3vO0BHn; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=jTCIOo8w; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CStrn5HF8z9sRR for ; Sat, 7 Nov 2020 21:33:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-ID:MIME-Version: Content-Type:Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=9GkPo5ty40dFVpWIL/6HQUYvHXjxGcyD7SXmrRX3Ydk=; b=u3vO0BHnsS/m7gKho1Rtklg+mY CfEmFdpuMtJv2oKXFzv7Ne22Zco0EGhorcxoVPFy8M4lU7vpev4OlMgDm7cDpxa88lLKWWJBuBdFi pPCQeJvTPMNdckFM/3S3RoaQmAslnBw5sKu6irVIWAnHW9cana23O4TH8uPvII6uWYbyaweR/Ok3k cxXOdzakK3AigcEm+8aoo5eXIp12QIEbGBCpRPqtVQTc4c26KnvL9NIXRVrvhwIRTP05YDumLmRCX Cs8K70z5pA+W2wPuVcbS4BWi6Cxe94xjnD2Y+agfLQLwo9EZb7zUqLkh1w4fh7wA265bu0JjqqWTj nzWIrUWg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kbLW9-0008ET-Gp; Sat, 07 Nov 2020 10:32:21 +0000 Received: from m1388.mail.163.com ([220.181.13.88]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kbLW6-0008Dk-Ib for hostap@lists.infradead.org; Sat, 07 Nov 2020 10:32:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=pkShf BXdHPV07JuIYzCTOCCZ2NfMbJnFCYQ5vONAKqs=; b=jTCIOo8wfZcMNcFFD/OQB 5eLDQBdL0Dd3WCwgSMmZcIXNG2Ot/Ho7RANoLSoEHALG0oIH3l5nH+L46U0UDkhm /r08cAs3FzC4nw7/gmsx+BIK/flPYc6BPzMnlqavXQfvsSNy9WMU9eIl2lBhIjP5 BVeuxIzwFfexYzaYLlUsnU= Received: from 18071720608$163.com ( [119.97.224.238] ) by ajax-webmail-wmsvr88 (Coremail) ; Sat, 7 Nov 2020 18:32:07 +0800 (CST) X-Originating-IP: [119.97.224.238] Date: Sat, 7 Nov 2020 18:32:07 +0800 (CST) From: "xing wan" <18071720608@163.com> To: hostap@lists.infradead.org Subject: [PATCH] wpa_supplicant: Should disconnect on deinit whatever WOWLAN is enable or disable X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT5.0.10 build 20190724(ac680a23) Copyright (c) 2002-2020 www.mailtech.cn 163com MIME-Version: 1.0 Message-ID: <19ca3f8f.1d6e.175a243665b.Coremail.18071720608@163.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: WMGowAAHMMOnd6Zfis+RAA--.22084W X-CM-SenderInfo: rpryilarxsilmqybiqqrwthudrp/xtbBEgfVeF6iZ2g50AAAsi X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201107_053219_102197_6AEA5BB8 X-CRM114-Status: UNSURE ( 5.46 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [220.181.13.88 listed in list.dnswl.org] 0.0 FROM_LOCAL_DIGITS From: localpart has long digit sequence 0.3 FROM_LOCAL_HEX From: localpart has long hexadecimal sequence 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [220.181.13.88 listed in wl.mailspike.net] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [18071720608[at]163.com] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [18071720608[at]163.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Dear Hostap organization -------------------------------------------------------- [wpa_supplicant] Rollback change list:02c21c02d09fdce55c0048cc58ff870cab77c9e9 [Description]   The function wpa_drv_get_wowlan() is to get signal of whether wowlan is triggered by wpa itself to kernel through wpa_drv_wowlan() function. Trigger action depends on the flag in wpa_supp.conf.   It must need to disconnect on interface deinit whatever WOWLAN is enable or disable, because deinit means that interface is removed or wpa_supplicant process killed.   If don't do so, the status between kernel/wifi driver and wpa_supplicant will be different and it will occur wifi unexpected behavior. E.g: when supplicant re-started up, the status of supplicant is disconnected while kernel and wifi driver is connected because wifi don't accept any disconnected or deauth signal before. And then, it could't scan any aps with scan cmd since kernel thinks wifi is already connected and block this scan flag. Signed-off-by: xing wan <18071720608@163.com> -------------------------------------------------------- diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index ea62e59..384b10a 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -6318,17 +6318,11 @@ wpa_s->disconnected = 1; if (wpa_s->drv_priv) { - /* Don't deauthenticate if WoWLAN is enabled */ - if (!wpa_drv_get_wowlan(wpa_s)) { - wpa_supplicant_deauthenticate( - wpa_s, WLAN_REASON_DEAUTH_LEAVING); + wpa_supplicant_deauthenticate(wpa_s, + WLAN_REASON_DEAUTH_LEAVING); - wpa_drv_set_countermeasures(wpa_s, 0); - wpa_clear_keys(wpa_s, NULL); - } else { - wpa_msg(wpa_s, MSG_INFO, - "Do not deauthenticate as part of interface deinit since WoWLAN is enabled"); - } + wpa_drv_set_countermeasures(wpa_s, 0); + wpa_clear_keys(wpa_s, NULL); } wpa_supplicant_cleanup(wpa_s);