Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4a7ff75 authored by Felix Fietkau's avatar Felix Fietkau Committed by Johannes Berg
Browse files

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: default avatarFelix Fietkau <nbd@openwrt.org>
[check local->use_chanctx]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent aacde9ee
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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;

	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