diff mbox series

[1/6] mac80211: never drop injected frames even if normally not allowed

Message ID 20200723100153.31631-1-Mathy.Vanhoef@kuleuven.be (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series mac80211: monitor mode injection fixes | expand

Commit Message

Mathy Vanhoef July 23, 2020, 10:01 a.m. UTC
In ieee80211_tx_dequeue there is a check to see if the dequeued frame
is allowed in the current state. Injected frames that are normally
not allowed are being be dropped here. Fix this by checking if a
frame was injected and if so always allowing it.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@kuleuven.be>
---
 net/mac80211/tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 1a2941e52..62d01ab26 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3618,7 +3618,7 @@  struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
 	tx.skb = skb;
 	tx.sdata = vif_to_sdata(info->control.vif);
 
-	if (txq->sta) {
+	if (txq->sta && !(info->flags & IEEE80211_TX_CTL_INJECTED)) {
 		tx.sta = container_of(txq->sta, struct sta_info, sta);
 		/*
 		 * Drop unicast frames to unauthorised stations unless they are