summaryrefslogtreecommitdiff
path: root/net/mac80211/wme.c
diff options
context:
space:
mode:
authorMathy Vanhoef <Mathy.Vanhoef@kuleuven.be>2020-11-04 10:18:21 +0400
committerJohannes Berg <johannes.berg@intel.com>2020-11-06 11:02:42 +0100
commit527d675969a1dff17baa270d4447ac1c87058299 (patch)
tree54bdfabe6d94f49f43bb72c618efb9c80e2d8156 /net/mac80211/wme.c
parent66d06c84730c8b148d93909ffbddf074fd771a48 (diff)
mac80211: don't overwrite QoS TID of injected frames
Currently ieee80211_set_qos_hdr sets the QoS TID of all frames based on the value assigned to skb->priority. This means it will also overwrite the QoS TID of injected frames. The commit 753ffad3d624 ("mac80211: fix TID field in monitor mode transmit") prevented injected frames from being modified because of this by setting skb->priority to the TID of the injected frame, which assured the QoS TID will not be changed to a different value. Unfortunately, this workaround complicates the handling of injected frames because we can't set skb->priority without affecting the TID value in the QoS field of injected frames. To avoid this, and to simplify the next patch, detect if a frame is injected in ieee80211_set_qos_hdr and if so do not change its QoS field. Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@kuleuven.be> Link: https://lore.kernel.org/r/20201104061823.197407-4-Mathy.Vanhoef@kuleuven.be [fix typos in commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r--net/mac80211/wme.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 3d7dea387e3d..2702d314ef59 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -252,6 +252,14 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
p = ieee80211_get_qos_ctl(hdr);
+ /* don't overwrite the QoS field of injected frames */
+ if (info->flags & IEEE80211_TX_CTL_INJECTED) {
+ /* do take into account Ack policy of injected frames */
+ if (*p & IEEE80211_QOS_CTL_ACK_POLICY_NOACK)
+ info->flags |= IEEE80211_TX_CTL_NO_ACK;
+ return;
+ }
+
/* set up the first byte */
/*