From patchwork Fri Oct 9 10:15:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11825511 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 41C2217CA for ; Fri, 9 Oct 2020 10:15:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3137F222B9 for ; Fri, 9 Oct 2020 10:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387573AbgJIKPe (ORCPT ); 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 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));