From f54d7dafa18a7ee0a976f03439d37ca160873f18 Mon Sep 17 00:00:00 2001
From: Leann Ogasawara <leann.ogasawara@canonical.com>
Date: Mon, 9 Apr 2012 12:47:26 -0700
Subject: [PATCH 1/2] UBUNTU: SAUCE:
 mac80211.compat08082009.wl_frag+ack_v1.patch

http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch

Packet injection may want to control the sequence number, so if an
injected packet is found, skip renumbering it. Also make the packet
NO_ACK to avoid excessive retries (ACKing and retrying should be handled
by the injecting application). FIXME This may break hostapd and some
other injectors. This should be done using a radiotap flag.

Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
---
 net/mac80211/tx.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index eff1f4e..02c19d8 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -792,11 +792,19 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
 
 	/*
 	 * Packet injection may want to control the sequence
-	 * number, if we have no matching interface then we
-	 * neither assign one ourselves nor ask the driver to.
+	 * number, so if an injected packet is found, skip
+	 * renumbering it. Also make the packet NO_ACK to avoid
+	 * excessive retries (ACKing and retrying should be
+	 * handled by the injecting application).
+	 * FIXME This may break hostapd and some other injectors.
+	 * This should be done using a radiotap flag.
 	 */
-	if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR))
+	if (unlikely((info->flags & IEEE80211_TX_CTL_INJECTED) &&
+	   !(tx->sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES))) {
+		if (!ieee80211_has_morefrags(hdr->frame_control))
+			info->flags |= IEEE80211_TX_CTL_NO_ACK;
 		return TX_CONTINUE;
+	}
 
 	if (unlikely(ieee80211_is_ctl(hdr->frame_control)))
 		return TX_CONTINUE;
-- 
1.7.9.1

