diff options
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r-- | net/mac80211/tx.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 7b013fb0d27f..f1c726d94f47 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1433,10 +1433,31 @@ int ieee80211_monitor_start_xmit(struct sk_buff *skb, | |||
1433 | struct net_device *dev) | 1433 | struct net_device *dev) |
1434 | { | 1434 | { |
1435 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 1435 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
1436 | struct ieee80211_channel *chan = local->hw.conf.channel; | ||
1436 | struct ieee80211_radiotap_header *prthdr = | 1437 | struct ieee80211_radiotap_header *prthdr = |
1437 | (struct ieee80211_radiotap_header *)skb->data; | 1438 | (struct ieee80211_radiotap_header *)skb->data; |
1438 | u16 len_rthdr; | 1439 | u16 len_rthdr; |
1439 | 1440 | ||
1441 | /* | ||
1442 | * Frame injection is not allowed if beaconing is not allowed | ||
1443 | * or if we need radar detection. Beaconing is usually not allowed when | ||
1444 | * the mode or operation (Adhoc, AP, Mesh) does not support DFS. | ||
1445 | * Passive scan is also used in world regulatory domains where | ||
1446 | * your country is not known and as such it should be treated as | ||
1447 | * NO TX unless the channel is explicitly allowed in which case | ||
1448 | * your current regulatory domain would not have the passive scan | ||
1449 | * flag. | ||
1450 | * | ||
1451 | * Since AP mode uses monitor interfaces to inject/TX management | ||
1452 | * frames we can make AP mode the exception to this rule once it | ||
1453 | * supports radar detection as its implementation can deal with | ||
1454 | * radar detection by itself. We can do that later by adding a | ||
1455 | * monitor flag interfaces used for AP support. | ||
1456 | */ | ||
1457 | if ((chan->flags & (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_RADAR | | ||
1458 | IEEE80211_CHAN_PASSIVE_SCAN))) | ||
1459 | goto fail; | ||
1460 | |||
1440 | /* check for not even having the fixed radiotap header part */ | 1461 | /* check for not even having the fixed radiotap header part */ |
1441 | if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header))) | 1462 | if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header))) |
1442 | goto fail; /* too short to be possibly valid */ | 1463 | goto fail; /* too short to be possibly valid */ |