From patchwork Wed May 20 05:09:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cy Schubert X-Patchwork-Id: 1293976 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=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=none (p=none dis=none) header.from=cschubert.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=BogvjFj6; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 49Rglw0QLKz9sT8 for ; Wed, 20 May 2020 15:09:32 +1000 (AEST) 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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Mime-Version:Subject:To: From:Message-Id:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=RyBzg7lCW8FAxvHR73z2lR57mgZIXejqtGCkqZMF57c=; b=BogvjFj6PR4O48 Pau77nkwR605f6ubUwRbyK78V/TUh6h7Jv6bZY8ig5BIbDbyngDz4SifEYRJhbnfJYKE/0D1tSbnI qdQs75F6Bn4Wm4nAS3A2FQByui+E+uSYcpE59OQyXF1KMAHgfqmOMk9wELgwantuDh+G2PcpbW8Yp qUXp3jCO34dF5k0WMyyQgLvyglIa+6GtF2xWDZ4BqiPfXP6Hrv+/oqF3LylofLkHTD6BuLCd+pYGk bYieqR8dsO7oDncMrU5/osmLop4DLu2lh3Szb/i6fS5XQQaRW0E5bcrOLgSObKdJSF5nHtDfjw38T gZAOI0EaGpkkjhhFhMZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbGyo-000799-Am; Wed, 20 May 2020 05:09:22 +0000 Received: from smtp-out-no.shaw.ca ([64.59.134.12]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbGyi-00078N-IV for hostap@lists.infradead.org; Wed, 20 May 2020 05:09:21 +0000 Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id bGyYjLwnN62brbGyaj8Qiy; Tue, 19 May 2020 23:09:09 -0600 X-Authority-Analysis: v=2.3 cv=LKf9vKe9 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=Nc-PI1ENw8TZCozxTFgA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 65D53106 for ; Tue, 19 May 2020 22:09:06 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 04K596ad013841 for ; Tue, 19 May 2020 22:09:06 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 04K5962M013838 for ; Tue, 19 May 2020 22:09:06 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005200509.04K5962M013838@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: hostap@lists.infradead.org Subject: [PATCH] BSD Log Spamming Mime-Version: 1.0 Date: Tue, 19 May 2020 22:09:06 -0700 X-CMAE-Envelope: MS4wfLyOQY1BOQKoV3ZZr34eMbEYyYFD9npu8h9bo2yGVTlxW11aYaW1wPGMxrZvDQN04sggNxwWo8KEPpI8WP43ccjlaw8qtIYQil1MXLSqMMXhDxQYQxpJ b+UVjgfe5M6Olb/kZKZzBBRbADGuDVPPKWmwnYDTmqQtZv85UCVdSNEVjnhJX3jVELa9msR3iHSQqg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200519_220916_649829_BFF52BCC X-CRM114-Status: UNSURE ( 8.51 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [64.59.134.12 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [64.59.134.12 listed in wl.mailspike.net] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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: , Reply-To: Cy Schubert Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi, On BSD, specifically FreeBSD, when disabling the RF radio on a laptop with communication device toggle key (as it's called on my laptop) otherwise known as the RF radio kill button, the following errors will be issued once per second: May 19 17:58:35 slippy wpa_supplicant[391]: wlan0: CTRL-EVENT-SCAN-FAILED ret=-1 retry=1 May 19 17:58:36 slippy wpa_supplicant[391]: ioctl[SIOCS80211, op=103, val=0, arg_len=128]: Device not configured On Intel the device will remain up however the IFF_RUNNING flag indicates whether the device is actually enabled and active. The following patch tests for this and avoids spamming syslog when RF is disabled. Silence the once per second CTRL-EVENT-SCAN-FAILED errors when the WiFi radio is disabled through the communication device toggle key (also known as the RF raidio kill button). Only the CTRL-EVENT-DISCONNECTED will be issued. Thoughts? Index: contrib/wpa/src/drivers/driver_bsd.c =================================================================== --- contrib/wpa/src/drivers/driver_bsd.c (revision 361269) +++ contrib/wpa/src/drivers/driver_bsd.c (working copy) @@ -1358,14 +1358,18 @@ drv = bsd_get_drvindex(global, ifm->ifm_index); if (drv == NULL) return; - if ((ifm->ifm_flags & IFF_UP) == 0 && - (drv->flags & IFF_UP) != 0) { + if (((ifm->ifm_flags & IFF_UP) == 0 || + (ifm->ifm_flags & IFF_RUNNING) == 0) && + (drv->flags & IFF_UP) != 0 && + (drv->flags & IFF_RUNNING) != 0) { wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' DOWN", drv->ifname); wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_DISABLED, NULL); } else if ((ifm->ifm_flags & IFF_UP) != 0 && - (drv->flags & IFF_UP) == 0) { + (ifm->ifm_flags & IFF_RUNNING) != 0 && + ((drv->flags & IFF_UP) == 0 || + (drv->flags & IFF_RUNNING) == 0)) { wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP", drv->ifname); wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED,