Search Linux Wireless

[PATCH] mac80211: do not TX injected frames when not allowed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Monitor mode is able to TX by using injected frames. We should
not allow injected frames to be sent unless allowed by regulatory rules.
Since AP mode uses a monitor interfaces to transmit management frames
we have to take care to not break AP mode as well. Since hostapd
respects 'no-ibss|radar' flags we can make use of the same policy
statically for checking when to disable injected frames. Once AP
mode supports radar detection we should somehow distinguish a
regular monitor mode from an AP's monitor interface.

Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---
 net/mac80211/tx.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 955f186..276a666 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -899,6 +899,16 @@ __ieee80211_parse_tx_radiotap(struct ieee80211_tx_data *tx,
 
 	sband = tx->local->hw.wiphy->bands[tx->channel->band];
 
+	/* Frame injection is not allowed if beaconing is not allowed
+	 * or if we need radar detection. Beaconing is usually not allowed when
+	 * the mode or operation (Adhoc, AP, Mesh) does not support DFS.
+	 * Since AP mode uses monitor interafaces to inject/TX management
+	 * frames once we have radar detection support we can change this
+	 * here */
+	if ((tx->channel->flags & (IEEE80211_CHAN_NO_IBSS |
+	    IEEE80211_CHAN_RADAR)))
+		return TX_DROP;
+
 	skb->do_not_encrypt = 1;
 	tx->flags &= ~IEEE80211_TX_FRAGMENTED;
 
-- 
1.6.1.rc3.51.g5832d

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux