mac80211: count interfaces correctly for combination checks
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Thu, 12 Mar 2015 06:53:30 +0000 (08:53 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 17 Apr 2015 00:11:38 +0000 (20:11 -0400)
commite6171aa2574c62e8b883280fb32bd3f8af0b9e59
treeb9f03a4e51a64ddc4cd90351e42670685a924212
parentd78408c0288dce070487844ba2694cd8c1114437
mac80211: count interfaces correctly for combination checks

[ Upstream commit 0f611d28fc2e13cfec64e1c544c16a086886805a ]

Since moving the interface combination checks to mac80211, it's
broken because it now only considers interfaces with an assigned
channel context, so for example any interface that isn't active
can still be up, which is clearly an issue; also, in particular
P2P-Device wdevs are an issue since they never have a chanctx.

Fix this by counting running interfaces instead the ones with a
channel context assigned.

Cc: stable@vger.kernel.org [3.16+]
Fixes: 73de86a38962b ("cfg80211/mac80211: move interface counting for combination check to mac80211")
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
[rewrite commit message, dig out the commit it fixes]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
net/mac80211/util.c