From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5ECDC433E7 for ; Fri, 9 Oct 2020 10:25:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58FBC22276 for ; Fri, 9 Oct 2020 10:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387648AbgJIKY6 (ORCPT ); Fri, 9 Oct 2020 06:24:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387615AbgJIKYr (ORCPT ); Fri, 9 Oct 2020 06:24:47 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20CE9C0613D5 for ; Fri, 9 Oct 2020 03:24:47 -0700 (PDT) Received: from [134.101.218.207] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1kQpOu-0004eZ-Jx; Fri, 09 Oct 2020 12:13:24 +0200 From: John Crispin To: Johannes Berg Cc: linux-kernel@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:13:17 +0200 Message-Id: <20201009101317.4657-5-john@phrozen.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201009101317.4657-1-john@phrozen.org> References: <20201009101317.4657-1-john@phrozen.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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