Skip to content

Commit

Permalink
mac80211: fix monitor mode injection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felix Fietkau authored and Johannes Berg committed Jan 16, 2013
1 parent aacde9e commit b4a7ff7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4a7ff7

Please sign in to comment.