Skip to content

Commit

Permalink
mac80211: allow tx via monitor iface when DFS
Browse files Browse the repository at this point in the history
Allow send frames using monitor interface
when DFS chandef and we pass CAC (beaconing
allowed).

This fix problem when old kernel and new backports used,
in such case hostapd create/use also monitor interface.
Before this patch all frames hostapd send using monitor
iface were dropped when AP was configured on DFS channel.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Janusz Dziedzic authored and Johannes Berg committed Jun 23, 2014
1 parent b7ffbd7 commit b493283
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1620,12 +1620,12 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_chanctx_conf *chanctx_conf;
struct ieee80211_channel *chan;
struct ieee80211_radiotap_header *prthdr =
(struct ieee80211_radiotap_header *)skb->data;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_hdr *hdr;
struct ieee80211_sub_if_data *tmp_sdata, *sdata;
struct cfg80211_chan_def *chandef;
u16 len_rthdr;
int hdrlen;

Expand Down Expand Up @@ -1723,9 +1723,9 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
}

if (chanctx_conf)
chan = chanctx_conf->def.chan;
chandef = &chanctx_conf->def;
else if (!local->use_chanctx)
chan = local->_oper_chandef.chan;
chandef = &local->_oper_chandef;
else
goto fail_rcu;

Expand All @@ -1745,10 +1745,11 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
* radar detection by itself. We can do that later by adding a
* monitor flag interfaces used for AP support.
*/
if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)))
if (!cfg80211_reg_can_beacon(local->hw.wiphy, chandef,
sdata->vif.type))
goto fail_rcu;

ieee80211_xmit(sdata, skb, chan->band);
ieee80211_xmit(sdata, skb, chandef->chan->band);
rcu_read_unlock();

return NETDEV_TX_OK;
Expand Down

0 comments on commit b493283

Please sign in to comment.