Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp582574rdb; Mon, 29 Jan 2024 11:09:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzNcrxytjXU/XA5Gk7q1mSjfXPMJEj0WGD4BgugbfOz8VQiG/SzK5HQWY4aabEvGRwde53 X-Received: by 2002:a17:906:5613:b0:a35:cd14:4147 with SMTP id f19-20020a170906561300b00a35cd144147mr1976000ejq.24.1706555358226; Mon, 29 Jan 2024 11:09:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706555358; cv=pass; d=google.com; s=arc-20160816; b=tnAa2tjg14BpdeAAN479wwRim1SO2g1mV9EhtD982BlBAPfZCFkjJXE5pto6OF4JZl YUackNEqFKXQ9+6643ojoJUttHCBUNjjzy+I/1nRF9cUtd0Q0hDBFtnbtC1nX3qicOM1 ygp/yAgsVHIH8x+ohBpuX/HefREYYN6xYy39+uC8lGS/HlEpIXZrnxIceHUrk1qcTDR6 MzTgr+buMDwqtZFZ/E5d25SiRO4JRu4Xvhx15A4T3V0ll1nx474ZVi3P31UNP5jyScMM lvklk1gril7/du2VAyve161zz4pM0qfXw+GrgMr20FQ5QD4pxNaeE/oI3UAJ4LxDdZyd dgUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=VmBnKlxSE1grhGs4+weDEjEfahkvqQF9Ye1eYlXBETo=; fh=ihP1K0sFkfDS3Vezdu1PF+ulEvQFpizRh/SiHGH9HKU=; b=YyDrKJb5YYTmJf77DvFnp2jBkovAxwhd8K1So7cya70L82mnDkSyoPTBi7Y8/q+HXo JZ0R63MyPt/cfRg0g999mCKSJGQsPTrtBuSeMuiwiRRTm53mS3DAH4zE5TYQw7US54ag vJMiZc3Fe5xWuKmm1LZGn13pRaH15AizxLJogdM+JJQucenr2wG7lg+JtnUkgYpocGGT N6oPw098wcmgclNWY3Yl6DrZdVb33eltXxjkJVEGrVLFE5zWel2bEOjv/RN3lfu9iXt2 iGkk0cMOh/aep4sC4nk/4X/Pj9vAVlxRbZ62pFVCQM/z6WRPxAs3bGRu2lwxck1gODqV Sx9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Sokao2ad; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2708-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2708-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=1; AJvYcCXGK2L1aDZonLfmE7pmUUdp3lkXJ+5Vl//6bpMQG569V53n2n6a2YMJAmJ0ybhjeuhzcZEbxS7gVI9hgK8pMVz/p3PWTaCH2mLpv2XD3w== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v7-20020a1709060b4700b00a352f23ab67si2839981ejg.178.2024.01.29.11.09.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 11:09:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2708-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Sokao2ad; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2708-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2708-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EEF551F2122F for ; Mon, 29 Jan 2024 19:09:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8258F76C85; Mon, 29 Jan 2024 19:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="Sokao2ad" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDC8C2E85E for ; Mon, 29 Jan 2024 19:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706555353; cv=none; b=g3g1+Blx/iMQQ3vmeM3+sJLeXdGyEA7bkufdNtwc2++B+V4aA9whQ7jJ5k6Ir5cqt6QOedt/64iomtczeRFOB9UVhh8MpkwCG37ESkyiwjUveuTTA4qJxaPajUctDo5BqmK2r0y45VNbm6ikMIlt4/9nX2sAVzacnJTtOjIGbGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706555353; c=relaxed/simple; bh=g2YFWJy0F/HWEKhA/D4xF03WqzUAxCYsJMcOCDa0TC0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=U1LvRbEIHnNK/TtWiJg++8GAu5pbOcPJ47koMEF2yma5YKB8DLM8oPh1bY0ghUVTqnRpr7BJHTqjpUrYxmNaMNO5twFJTkABVyq2+OY1JwLBKsc9daw59MF0+rk2Zujd7vvgSBdxjAXNLN3xKftgzUow0y1ZCDRvdYwu2TbFCWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=Sokao2ad; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=VmBnKlxSE1grhGs4+weDEjEfahkvqQF9Ye1eYlXBETo=; t=1706555352; x=1707764952; b=Sokao2adLR8KLVpNs403ZTzMVcE9R2BUWTDdGPyIYU2OLMroLk3ItwiIZMR+zlgPns/FxyUu8i5 cIoREQzOefywKqBkdrwiPTYTO4tUrc0bC7CO+qOCLcdK2WfI4UrkJGUlKcF1iObcCY+LgLfPqMBvh ftyj/b+DDWKjvSzxSnT6RXBeXOYksyE8yn6h95VJQnIxTvkTZIPvLR/hCNTxTnM8Ntnt128csxpB4 6f+RWmfCFWgyKlgX47+gGiljxunpVhwSuwNLgHSwt5NwoKGDwm7E9ye1QEg69hIahoxQuGrTLlPxm qWMvtggA9U4Ny4buRrad64G32uuKzrQeoIvQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUX0H-000000050Gb-0TKt; Mon, 29 Jan 2024 20:09:09 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH] wifi: mac80211: accept broadcast probe responses on 6 GHz Date: Mon, 29 Jan 2024 20:09:07 +0100 Message-ID: <20240129200907.5a89c2821897.I92e9dfa0f9b350bc7f37dd4bb38031d156d78d8a@changeid> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg On the 6 GHz band, probe responses are sent as broadcast to optimise medium usage. However, without OCE configuration we weren't accepting them, which is wrong, even if wpa_s is by default enabling OCE. Accept them without the OCE config as well. Signed-off-by: Johannes Berg --- net/mac80211/scan.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 645355e5f1bc..f9d5842601fa 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -9,7 +9,7 @@ * Copyright 2007, Michael Wu * Copyright 2013-2015 Intel Mobile Communications GmbH * Copyright 2016-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation */ #include @@ -237,14 +237,18 @@ ieee80211_bss_info_update(struct ieee80211_local *local, } static bool ieee80211_scan_accept_presp(struct ieee80211_sub_if_data *sdata, + struct ieee80211_channel *channel, u32 scan_flags, const u8 *da) { if (!sdata) return false; - /* accept broadcast for OCE */ - if (scan_flags & NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP && - is_broadcast_ether_addr(da)) + + /* accept broadcast on 6 GHz and for OCE */ + if (is_broadcast_ether_addr(da) && + (channel->band == NL80211_BAND_6GHZ || + scan_flags & NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP)) return true; + if (scan_flags & NL80211_SCAN_FLAG_RANDOM_ADDR) return true; return ether_addr_equal(da, sdata->vif.addr); @@ -293,6 +297,12 @@ void ieee80211_scan_rx(struct ieee80211_local *local, struct sk_buff *skb) wiphy_delayed_work_queue(local->hw.wiphy, &local->scan_work, 0); } + channel = ieee80211_get_channel_khz(local->hw.wiphy, + ieee80211_rx_status_to_khz(rx_status)); + + if (!channel || channel->flags & IEEE80211_CHAN_DISABLED) + return; + if (ieee80211_is_probe_resp(mgmt->frame_control)) { struct cfg80211_scan_request *scan_req; struct cfg80211_sched_scan_request *sched_scan_req; @@ -310,19 +320,15 @@ void ieee80211_scan_rx(struct ieee80211_local *local, struct sk_buff *skb) /* ignore ProbeResp to foreign address or non-bcast (OCE) * unless scanning with randomised address */ - if (!ieee80211_scan_accept_presp(sdata1, scan_req_flags, + if (!ieee80211_scan_accept_presp(sdata1, channel, + scan_req_flags, mgmt->da) && - !ieee80211_scan_accept_presp(sdata2, sched_scan_req_flags, + !ieee80211_scan_accept_presp(sdata2, channel, + sched_scan_req_flags, mgmt->da)) return; } - channel = ieee80211_get_channel_khz(local->hw.wiphy, - ieee80211_rx_status_to_khz(rx_status)); - - if (!channel || channel->flags & IEEE80211_CHAN_DISABLED) - return; - bss = ieee80211_bss_info_update(local, rx_status, mgmt, skb->len, channel); -- 2.43.0