aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-13 23:10:26 +0100
committerJohannes Berg <johannes.berg@intel.com>2013-01-16 15:09:31 +0100
commitb4a7ff75ba3545b061d4fe63f0bb9136ccfe8b19 (patch)
tree062425959161236359bf628017cb6d940e09aabe /net/mac80211/tx.c
parentmac80211: synchronize scan off/on-channel and PS states (diff)
downloadlinux-dev-b4a7ff75ba3545b061d4fe63f0bb9136ccfe8b19.tar.xz
linux-dev-b4a7ff75ba3545b061d4fe63f0bb9136ccfe8b19.zip
mac80211: fix monitor mode injection
Channel contexts are not always used with monitor interfaces. If no channel context is set, use the oper channel, otherwise tx fails. Signed-off-by: Felix Fietkau <nbd@openwrt.org> [check local->use_chanctx] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index e9eadc40c09c..467c1d1b66f2 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1673,10 +1673,13 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
chanctx_conf =
rcu_dereference(tmp_sdata->vif.chanctx_conf);
}
- if (!chanctx_conf)
- goto fail_rcu;
- chan = chanctx_conf->def.chan;
+ if (chanctx_conf)
+ chan = chanctx_conf->def.chan;
+ else if (!local->use_chanctx)
+ chan = local->_oper_channel;
+ else
+ goto fail_rcu;
/*
* Frame injection is not allowed if beaconing is not allowed