From patchwork Tue Nov 3 09:17:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11876371 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 723A76A2 for ; Tue, 3 Nov 2020 09:17:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 587CF22400 for ; Tue, 3 Nov 2020 09:17:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726212AbgKCJRx (ORCPT ); Tue, 3 Nov 2020 04:17:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbgKCJRw (ORCPT ); Tue, 3 Nov 2020 04:17:52 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A11DC061A47 for ; Tue, 3 Nov 2020 01:17:52 -0800 (PST) Received: from [149.224.151.57] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1kZsRp-0006BN-CH; Tue, 03 Nov 2020 10:17:49 +0100 From: John Crispin To: Johannes Berg Cc: linux-wireless@vger.kernel.org, John Crispin , Aloka Dixit Subject: [PATCH V5 4/4] mac80211: don't allow CSA on non-transmitting interfaces Date: Tue, 3 Nov 2020 10:17:43 +0100 Message-Id: <20201103091743.1924854-5-john@phrozen.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201103091743.1924854-1-john@phrozen.org> References: <20201103091743.1924854-1-john@phrozen.org> MIME-Version: 1.0 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 cfe38480a3fc..457a956bb637 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3508,6 +3508,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));