From: warmcat <andy@warmcat.com>
To: linux-wireless@vger.kernel.org
Subject: [PATCH] mac80211: No echo TX pkt to Monitor interfaces for injection
Date: Thu, 02 Aug 2007 23:38:57 +0100 [thread overview]
Message-ID: <20070802223857.19090.70108.stgit@localhost> (raw)
Block of code at the end of ieee80211_tx_status() seems to exist in order
to echo tx packets down Monitor mode interfaces with a synthesized
radiotap preamble describing the outcome of the transmission.
The effect it has with injected packets is that two copies of each
injected packet appears on the soft Monitor mode interface it was injected
down, one with a correct radiotap header reflecting what was injected,
and one with a bogus 0x0b length radiotap header. This behaviour
was seen on iwl3945 and rt73usb.
This patch adds a new attribute to ieee80211_tx_control's flags field,
IEEE80211_TXCTL_NO_SOFT_MONITOR_ECHO, which is set for injected
packets. The code to add a new radiotap header and echo the packet
down monitor mode interfaces is now conditional on this attribute not
being set.
Signed-off-by: Andy Green <andy@warmcat.com>
---
include/net/mac80211.h | 1 +
net/mac80211/ieee80211.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 17a4dd7..6bf8f7b 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -192,6 +192,7 @@ struct ieee80211_tx_control {
#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of
* the frame */
#define IEEE80211_TXCTL_TKIP_NEW_PHASE1_KEY (1<<9)
+#define IEEE80211_TXCTL_NO_SOFT_MONITOR_ECHO (1<<10)
u32 flags; /* tx control flags defined
* above */
u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. */
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 7dda339..b094274 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -1309,6 +1309,7 @@ __ieee80211_tx_prepare(struct ieee80211_txrx_data *tx,
TXRX_DROP) {
return TXRX_DROP;
}
+ control->flags |= IEEE80211_TXCTL_NO_SOFT_MONITOR_ECHO;
/*
* we removed the radiotap header after this point,
* we filled control with what we could use
@@ -4850,6 +4851,9 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
rthdr->data_retries = status->retry_count;
+ if (status->control.flags & IEEE80211_TXCTL_NO_SOFT_MONITOR_ECHO)
+ goto out_no_echo;
+
read_lock(&local->sub_if_lock);
monitors = local->monitors;
list_for_each_entry(sdata, &local->sub_if_list, list) {
@@ -4885,6 +4889,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
}
out:
read_unlock(&local->sub_if_lock);
+ out_no_echo:
if (skb)
dev_kfree_skb(skb);
}
next reply other threads:[~2007-08-02 22:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-02 22:38 warmcat [this message]
2007-08-03 9:57 ` [PATCH] mac80211: No echo TX pkt to Monitor interfaces for injection Johannes Berg
2007-08-03 10:15 ` Andy Green
2007-08-03 10:23 ` Johannes Berg
2007-08-03 10:34 ` Andy Green
2007-08-03 10:43 ` Johannes Berg
2007-08-06 19:33 ` Johannes Berg
2007-08-07 9:47 ` Andy Green
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070802223857.19090.70108.stgit@localhost \
--to=andy@warmcat.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).