aboutsummaryrefslogtreecommitdiffstats
path: root/package/madwifi/patches/436-injection_checks.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-05-30 17:53:41 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-05-30 17:53:41 +0000
commita552940d2489c67a989e3b47b2aab8b5b9340c8a (patch)
tree082191efccaf128e31aa617126ab5aa9dd7aa672 /package/madwifi/patches/436-injection_checks.patch
parentcf3983e001e5f7b467b404d6041a720b42c099c4 (diff)
downloadupstream-a552940d2489c67a989e3b47b2aab8b5b9340c8a.tar.gz
upstream-a552940d2489c67a989e3b47b2aab8b5b9340c8a.tar.bz2
upstream-a552940d2489c67a989e3b47b2aab8b5b9340c8a.zip
madwifi: add sanity checks for monitor mode injection
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16218 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/madwifi/patches/436-injection_checks.patch')
-rw-r--r--package/madwifi/patches/436-injection_checks.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/package/madwifi/patches/436-injection_checks.patch b/package/madwifi/patches/436-injection_checks.patch
new file mode 100644
index 0000000000..7bdd82c0f9
--- /dev/null
+++ b/package/madwifi/patches/436-injection_checks.patch
@@ -0,0 +1,26 @@
+--- a/ath/if_ath.c
++++ b/ath/if_ath.c
+@@ -3199,7 +3199,13 @@ ath_tx_startraw(struct net_device *dev,
+ struct ieee80211_frame *wh;
+
+ wh = (struct ieee80211_frame *)skb->data;
++
+ try0 = ph->try0;
++ if (!try0)
++ try0 = 1;
++ else if (try0 > 11)
++ try0 = 11;
++
+ rt = sc->sc_currates;
+ txrate = dot11_to_ratecode(sc, rt, ph->rate0);
+ power = ph->power > 63 ? 63 : ph->power;
+@@ -3224,7 +3230,8 @@ ath_tx_startraw(struct net_device *dev,
+ rt = sc->sc_currates;
+ KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
+
+- if (IEEE80211_IS_MULTICAST(wh->i_addr1)) {
++ if (((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_DATA) ||
++ IEEE80211_IS_MULTICAST(wh->i_addr1)) {
+ flags |= HAL_TXDESC_NOACK; /* no ack on broad/multicast */
+ sc->sc_stats.ast_tx_noack++;
+ try0 = 1;