mac80211: fix monitor mode injection
PATCH 1/1 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 <[email protected]>
--- net/mac80211/tx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/mac80211/tx.c +4 -4
@@ -1673,10 +1673,10 @@ 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 + chan = local->_oper_channel;/* * Frame injection is not allowed if beaconing is not allowed
Signature · 1 line
1.8.0.2
Johannes Berg
maintainerQuoted 2 lines · Felix Fietkau
Channel contexts are not always used with monitor interfaces. If no channel context is set, use the oper channel, otherwise tx fails.
Applied, but I also added a check for local->use_chanctx.
johannes