* [PATCH] mac80211: enable to inject a-msdu frames using monitor interface
@ 2016-10-07 20:29 Michael Braun
2016-10-10 10:16 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Michael Braun @ 2016-10-07 20:29 UTC (permalink / raw)
To: johannes; +Cc: Michael Braun, linux-wireless, projekt-wlan
Problem: When injecting an A-MSDU using a PF_PACKET socket, the qos flag
IEEE80211_QOS_CTL_A_MSDU_PRESENT is cleared.
How to reproduce: Inject a frame on a mac80211 hwsim monitor interface and
have tshark sniffing on this monitor interface.
You'll see the packet twice: Once with correct flag and once with flag
cleared. On hwsim0, you'll only see the packet with a cleared flag.
I guess the same is needed for packets with IEEE80211_TX_CTRL_AMSDU set.
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
---
net/mac80211/wme.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 9eb0aee..3faa972 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -248,6 +248,13 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
/* preserve EOSP bit */
ack_policy = *p & IEEE80211_QOS_CTL_EOSP;
+ /* preserve A-MSDU bit for MONITOR interfaces to allow injecting
+ * A-MSDU frames
+ */
+ if (info->flags & IEEE80211_TX_CTL_INJECTED ||
+ info->control.flags & IEEE80211_TX_CTRL_AMSDU)
+ ack_policy |= *p & IEEE80211_QOS_CTL_A_MSDU_PRESENT;
+
if (is_multicast_ether_addr(hdr->addr1) ||
sdata->noack_map & BIT(tid)) {
ack_policy |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mac80211: enable to inject a-msdu frames using monitor interface
2016-10-07 20:29 [PATCH] mac80211: enable to inject a-msdu frames using monitor interface Michael Braun
@ 2016-10-10 10:16 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2016-10-10 10:16 UTC (permalink / raw)
To: Michael Braun; +Cc: linux-wireless, projekt-wlan
On Fri, 2016-10-07 at 22:29 +0200, Michael Braun wrote:
>
> I guess the same is needed for packets with IEEE80211_TX_CTRL_AMSDU
> set.
I don't think that's true, since we don't get here after A-MSDU
building in mac80211.
> /* preserve EOSP bit */
> ack_policy = *p & IEEE80211_QOS_CTL_EOSP;
>
> + /* preserve A-MSDU bit for MONITOR interfaces to allow
> injecting
> + * A-MSDU frames
> + */
> + if (info->flags & IEEE80211_TX_CTL_INJECTED ||
> + info->control.flags & IEEE80211_TX_CTRL_AMSDU)
> + ack_policy |= *p & IEEE80211_QOS_CTL_A_MSDU_PRESENT;
However, why not just unconditionally preserve it?
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-10 10:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-07 20:29 [PATCH] mac80211: enable to inject a-msdu frames using monitor interface Michael Braun
2016-10-10 10:16 ` Johannes Berg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.