From patchwork Thu Mar 12 06:53:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 5991031 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 81ECC9F2A9 for ; Thu, 12 Mar 2015 06:54:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C137D20377 for ; Thu, 12 Mar 2015 06:54:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8BC620375 for ; Thu, 12 Mar 2015 06:54:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752663AbbCLGxx (ORCPT ); Thu, 12 Mar 2015 02:53:53 -0400 Received: from mga01.intel.com ([192.55.52.88]:19662 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752591AbbCLGxt (ORCPT ); Thu, 12 Mar 2015 02:53:49 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 11 Mar 2015 23:53:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,387,1422950400"; d="scan'208";a="539775777" Received: from egrumbacbox.jer.intel.com ([10.12.118.74]) by orsmga003.jf.intel.com with ESMTP; 11 Mar 2015 23:53:05 -0700 From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Andrei Otcheretianski , Emmanuel Grumbach Subject: [PATCH 7/7] mac80211: Count correctly interface types Date: Thu, 12 Mar 2015 08:53:30 +0200 Message-Id: <1426143210-25635-7-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426143210-25635-1-git-send-email-emmanuel.grumbach@intel.com> References: <1426143210-25635-1-git-send-email-emmanuel.grumbach@intel.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrei Otcheretianski Previously, interface combination check in mac80211 considered only interfaces that have channel context. This wouldn't take P2P device interfaces into account at all. Also for managed interfaces the channel context is bound upon association and the combination check is performed when the iface is brought up. Fix this by counting the numbers of running interfaces instead of number of interfaces that have channel context. Signed-off-by: Andrei Otcheretianski Signed-off-by: Emmanuel Grumbach --- net/mac80211/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index e664b28..36d8cb2 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -3245,7 +3245,7 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata, wdev_iter = &sdata_iter->wdev; if (sdata_iter == sdata || - rcu_access_pointer(sdata_iter->vif.chanctx_conf) == NULL || + !ieee80211_sdata_running(sdata_iter) || local->hw.wiphy->software_iftypes & BIT(wdev_iter->iftype)) continue;