Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp739404rwd; Thu, 8 Jun 2023 07:10:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tcFlaQBhYb0Y58ZNK/9buMmaSTLrRK8apezeXOcJppaRLxTApzX0GrfO4wntMT5YQzMzP X-Received: by 2002:a17:902:ea0a:b0:1ac:d03a:9702 with SMTP id s10-20020a170902ea0a00b001acd03a9702mr10011108plg.67.1686233422121; Thu, 08 Jun 2023 07:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686233422; cv=none; d=google.com; s=arc-20160816; b=cFOeolGtIDIYkNprV1NeVBfnT4UBmi5RY00Nen9ai60/HkV/am40fsE6UrqOaoCetF ckLOZgeKDenBw6teFY8wbaR0RQi2SN1vw1U8LI29LWoZEeLOknVtuatNv64wRR2gE2oi 2tgm76o5h4QSMHYUGR1/x6l+J/mRM0D6ax9wERMs/YaoAFjpJa6AoV9I0eQJFHOqIuby suR2SMj/G5dTA3Urz7paLU3h3I94HuI3iDQp1/IvvHpovV6ik54HKfSSCHVyEIGdSr0t /4Ko0GvEBDe4loZ57NuskbFJYv5phhXplQGph+m/Do/h9+s1/LcYjlBrQnmlSaZnhBer Q3wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NPDtlki0I3UO4QRwU9YL75A0JtTloOGBhAR7PGOBPkU=; b=MICE7TfN+au1XCYzZB5yGT4oaOPvV11he7l/G1Y34D20sRdWJpWxji02DrFg/U3LPS 85WUAz7RBR7cFaw6MkVFd+sX13CWCKFU1c7lLHkutQICGl3wZgwlR0s93Pifw5VqxwOF iBY3SHknciBEDZRNUc/4YIxDGBZZlgKKSrytzbuIDuvCUHi9wBubQcDr1ru5RgADD8aN z08bBmFtk6/dza7BjsA5PWtgceWpu/I4gGiOMuRrKut7YtRUIpBGncnUZt9LZdZlFmS2 EY6WO/NPx0Gi8kmWvMU/U0CpES3X5KrWqjmd5BOq89WZd4KdNA+Y1ugPzOvaX5Q68mRk O/9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fS6reJJn; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ju19-20020a170903429300b001b039693da8si1061542plb.635.2023.06.08.07.10.14; Thu, 08 Jun 2023 07:10:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fS6reJJn; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236843AbjFHOHW (ORCPT + 61 others); Thu, 8 Jun 2023 10:07:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236831AbjFHOHP (ORCPT ); Thu, 8 Jun 2023 10:07:15 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D3A830C0 for ; Thu, 8 Jun 2023 07:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686233234; x=1717769234; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TgT4wsb6c7Es+Urk5Tdw4BuJ+a/TJjwpyFe774/LmQ0=; b=fS6reJJnpTLk94VpoSdM3DOPvX0ytiYBma9pDkDbI8jvxa1g3dS1E0Vr 60PQab8lrFENNYuVIHs+HU+F7zc4elpfE6UiOcQx2xefgQKy2AP+O/dk9 u2mLitPMBzPsYo+En0jXwCMIWwn2mlVvkc8R2pDVaGtZ7+z43YpAywxip tU5VZG4YSLMqHbZl6iceYj+No7wGFFSdIKZybjv1/7aGnnaAuaeEN9vYm 1BbKUtx+lLcLXkgBecNuBqE8HwgK+dzyLbTP4zoYUjKCTaaOyQgx4KCyk 5oCat4Do7vxsbU2P9vKnEJwM9Za25QVuzuLHDSkQgENM9wQtsiu9R0S/9 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="423176230" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="423176230" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 06:36:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="956706226" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="956706226" Received: from unknown (HELO ggreenma-mobl2.intel.com) ([10.249.94.100]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 06:36:37 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Gregory Greenman Subject: [PATCH 07/15] wifi: mac80211: fix CSA processing while scanning Date: Thu, 8 Jun 2023 16:36:03 +0300 Message-Id: <20230608163202.3366e9302468.I6c7e0b58c33b7fb4c675374cfe8c3a5cddcec416@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230608133611.1303724-1-gregory.greenman@intel.com> References: <20230608133611.1303724-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Benjamin Berg The channel switch parsing code would simply return if a scan is in-progress. Supposedly, this was because channel switch announcements from other APs should be ignored. For the beacon case, the function is already only called if we are associated with the sender. For the action frame cases, add the appropriate check whether the frame is coming from the AP we are associated with. Finally, drop the scanning check from ieee80211_sta_process_chanswitch. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman --- net/mac80211/mlme.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index f13792994b4f..d1e30ff54c1f 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1857,9 +1857,6 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link, if (!cbss) return; - if (local->scanning) - return; - current_band = cbss->channel->band; bss = (void *)cbss->priv; res = ieee80211_parse_ch_switch_ie(sdata, elems, current_band, @@ -5997,6 +5994,10 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, ieee80211_rx_mgmt_assoc_resp(sdata, mgmt, skb->len); break; case IEEE80211_STYPE_ACTION: + if (!sdata->u.mgd.associated || + !ether_addr_equal(mgmt->bssid, sdata->vif.cfg.ap_addr)) + break; + if (mgmt->u.action.category == WLAN_CATEGORY_SPECTRUM_MGMT) { struct ieee802_11_elems *elems; -- 2.38.1