Skip to contentSkip to conversation

mac80211: fix monitor mode injection

PATCH In review Felix Fietkau 2 participants 2 messages Jan 13, 2013 – Jan 16, 2013 mac80211

lore
Share & tools
lore
#0 lore raw

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.

---
 net/mac80211/tx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
net/mac80211/tx.c +4 -4
index e9eadc4..8010879 100644
@@ -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
maintainer
#1 lore raw
Quoted 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