From: Felix Fietkau Date: Sun, 13 Jan 2013 22:10:26 +0000 (+0100) Subject: mac80211: fix monitor mode injection X-Git-Tag: v3.8-rc6~20^2~10^2^2~6^2~2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b4a7ff75ba3545b061d4fe63f0bb9136ccfe8b19;p=~emulex%2Finfiniband.git 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 [check local->use_chanctx] Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index e9eadc40c09..467c1d1b66f 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