From nobody Thu Feb 23 21:14:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PN5PD10TYz3smW4; Thu, 23 Feb 2023 21:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PN5PD0XPZz3J1R; Thu, 23 Feb 2023 21:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677186848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OEP+8WyaaBgOLdOJJVZDRG23P7bksrtCfOB7ffOzIdk=; b=cIW11DaPngDw3Ont8oASMQUK0Os3+R2DZ9JYhds+2ThMsXw8e51j4SEQAkdLaBEfqJ8dru GA3D6LCy2B55qeqzzAs79/eI/b+tNDChY4NydTGYCCrX09/UykS01aTW4sWXdgbNX0M8Pl 3hi/JIblLK5hE0T1hzrW5CqyZ/jvY5ORlGpUoZ7nP2wLbaPBhdiT6xFsbJCHBB2GGgOaxE oTBWu9ZUbP3sOWA9F0uFj5A2Tw1JuBaYN+WfCc3W0IN+q/aOtQGLFV8+QdlnceEI3WXQ8K BV0cgSNfITDwtspAfwWV5gdBYqo3ScFQDneN8Rri4oJ+hm9Zi052DDBmCrppQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677186848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OEP+8WyaaBgOLdOJJVZDRG23P7bksrtCfOB7ffOzIdk=; b=DrJy73rUdGt/K/QOBj6AK4wGVXLqmSOs32UdMTA+dT8qwyyuQVngNyU5/McQ6iihibIO2f vvygUZ5ZGEjVkX0/s26ufNEWdHXIQypPKN9e1wrGQxyqFwTaouWFDkHXljcRlidDEaOemP 5HLbW6qMxxAol8qiUZxtuiK41ZJIhyvANHXsPBdvrwzImL+5124M/Nz2Xz63rHXoH6XgaH +nY+BGtBePUnfMrBi9Q69dPfuoONFN/meivMpOCxc2rZbdTcTQRQu7zNMYFKBHKw/ZaUlV rOPF+Y0lm4LUk1FdSgIrg+HjbMQkbVB+iFR4Dzc91jFYpqWX4MSql5fo9bpyZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677186848; a=rsa-sha256; cv=none; b=Atk8oD56tkqswx9dftpuOb08u2qR8EPzQF2A2z8GeEq8dIaLIC0wvXNWLG7e8W+FIpe+qU IZZgFpO53vabYSEruv4W/UW2HunzYfmvnD9IrSwRVCADqz45UbXOfMxDbn3m5HtzndNzkd evtIk3SDSquH8rsOJ2tgOziRl7wNl8ALC15nqCD+6/6J9MpnbcQVceppvp6mOwS43MQygB bhlglE29Tllu6Aao/jwpD9yFmodUevT8wMWnOdR6lcf/EU6Howf1o0LoYEWzL+dJiT3pZp BZA9wCsQeO0O4A8/6v6Z1dlhyt7sb8mVY0qA2YqZsmCf4Iob7a53EpfwlzqEAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PN5PC6hrszxfC; Thu, 23 Feb 2023 21:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31NLE7WC063598; Thu, 23 Feb 2023 21:14:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NLE7Vp063597; Thu, 23 Feb 2023 21:14:07 GMT (envelope-from git) Date: Thu, 23 Feb 2023 21:14:07 GMT Message-Id: <202302232114.31NLE7Vp063597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c9ba91435a01 - main - net80211: ieee80211_swscan_bg_scan() track return variable under lock List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9ba91435a01a80632a5b68144d75b38241fc8be Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c9ba91435a01a80632a5b68144d75b38241fc8be commit c9ba91435a01a80632a5b68144d75b38241fc8be Author: Bjoern A. Zeeb AuthorDate: 2023-02-18 01:15:21 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-02-23 21:12:23 +0000 net80211: ieee80211_swscan_bg_scan() track return variable under lock As the comment says it probably does not matter but use a local variable to track state under lock so we can return the last known good state of what we thought we were operating under after unlocking. Likely no functional changes. Sponsored by: The FreeBSD Foundation MFC atfer: 3 days Reviewed by: enweiwu, adrian Differential Revision: https://reviews.freebsd.org/D38660 --- sys/net80211/ieee80211_scan_sw.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_scan_sw.c b/sys/net80211/ieee80211_scan_sw.c index 1456fafd60a1..51e1189824e3 100644 --- a/sys/net80211/ieee80211_scan_sw.c +++ b/sys/net80211/ieee80211_scan_sw.c @@ -336,12 +336,14 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan, { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_scan_state *ss = ic->ic_scan; + bool scanning; /* XXX assert unlocked? */ // IEEE80211_UNLOCK_ASSERT(ic); IEEE80211_LOCK(ic); - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { + scanning = ic->ic_flags & IEEE80211_F_SCAN; + if (!scanning) { u_int duration; /* * Go off-channel for a fixed interval that is large @@ -405,6 +407,7 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan, ic->ic_flags_ext |= IEEE80211_FEXT_BGSCAN; ieee80211_runtask(ic, &SCAN_PRIVATE(ss)->ss_scan_start); + scanning = true; } else { /* XXX msg+stat */ } @@ -415,8 +418,7 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanner *scan, } IEEE80211_UNLOCK(ic); - /* NB: racey, does it matter? */ - return (ic->ic_flags & IEEE80211_F_SCAN); + return (scanning); } /*