Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2000396pxu; Fri, 9 Oct 2020 05:34:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwv0ykmm5GoLpjK7EuLW1tbwR6ReFxvYBMwL4c/ZMBax/gWG+B2Q3egyPyjk+B5aV/y+r0v X-Received: by 2002:a17:906:f112:: with SMTP id gv18mr13675583ejb.180.1602246882964; Fri, 09 Oct 2020 05:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602246882; cv=none; d=google.com; s=arc-20160816; b=Ql2+AeMlihqiFcwPHlIpndXiM+8yH4EqP5wZwkIiopCs7gIRt+Lkzk7SlE5Bvb3RFL ouiT/zlNyk+MyEcMWCQ9SlPTC6Y0iMkRGaA4/BIK6L7XSihtuKzeypoW1ANrTGlEVLXc ZNEe4n7uMnr9KJsEAe/GSw5Lu0CAblarpTXCXqy8G2f3QSqfZrsexGTl4VRbBHnFDLMZ C+e8wEfruJNcN6iARIlLBru/DxcY5B2Dycd9RQDK2LeojsH5AUqgTx9PIVT/6H185+Q0 0fCIMiUlcM+FFUWUA2xvTE9jIMeW6pOhyxTc2ZJ+13o3Ild03y8CMQOv293iLhIApf8Y dZWA== 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; bh=EM1K9S4cOF8xksrLq8DclfVPd7KVjWiuhRWJhiTa2fQ=; b=qweLyQcyXJgQZVy7pBAiYY9wUnk2V9FTcBg0oa82hd/OkRvQURWk/KBmFcDAmDz5Dv ZNgvliPJbz4aI2xpvmAuKsHVYk5gtiPL8CeksP4mXMIvdpdeUjhkntz/ofWEgBqimNhE HqsHpT2Da+AvR2HwI8P5WoxrUofPamhVoroMYMYpLmrhk1zeJSwqmcZhbqxXXOfw8x1N nGJamEgZxEi/s7VvyMd2yz6iS2S5Rk4rR+yoRq71YxEMYMeLgeCQK6hrdnhmgezTQziU +VL3506mCMLGsAIs0DM+/Oe8k9QxjnIU/ZeeVUXsjzxVNnxWJqHRUMNaSWr0XOkdvpXV 3dVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp13si3847775ejc.122.2020.10.09.05.34.17; Fri, 09 Oct 2020 05:34:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387573AbgJIKPe (ORCPT + 99 others); Fri, 9 Oct 2020 06:15:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387569AbgJIKPd (ORCPT ); Fri, 9 Oct 2020 06:15:33 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DDFCC0613D4 for ; Fri, 9 Oct 2020 03:15:33 -0700 (PDT) Received: from [134.101.218.207] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1kQpQw-0004jy-Vo; Fri, 09 Oct 2020 12:15:31 +0200 From: John Crispin To: Johannes Berg Cc: linux-wireless@vger.kernel.org, John Crispin , Aloka Dixit Subject: [PATCH V4 4/4] mac80211: don't allow CSA on non-transmitting interfaces Date: Fri, 9 Oct 2020 12:15:28 +0200 Message-Id: <20201009101528.4780-5-john@phrozen.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201009101528.4780-1-john@phrozen.org> References: <20201009101528.4780-1-john@phrozen.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org As a non-transmitting interface does not broadcast a beacon, we do not want to allow channel switch announcements. They need to be triggered on the transmitting interface. Signed-off-by: Aloka Dixit Signed-off-by: John Crispin --- net/mac80211/cfg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 11cecb2ed640..7693894c4f84 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3504,6 +3504,9 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, if (sdata->vif.csa_active) return -EBUSY; + if (sdata->vif.multiple_bssid.flags & IEEE80211_VIF_MBSS_NON_TRANSMITTING) + return -EINVAL; + mutex_lock(&local->chanctx_mtx); conf = rcu_dereference_protected(sdata->vif.chanctx_conf, lockdep_is_held(&local->chanctx_mtx)); -- 2.25.1