Skip to content

Commit b493283

Browse files
dziedjanjmberg-intel
authored andcommitted
mac80211: allow tx via monitor iface when DFS
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>
1 parent b7ffbd7 commit b493283

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎net/mac80211/tx.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,12 +1620,12 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
16201620
{
16211621
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
16221622
struct ieee80211_chanctx_conf *chanctx_conf;
1623-
struct ieee80211_channel *chan;
16241623
struct ieee80211_radiotap_header *prthdr =
16251624
(struct ieee80211_radiotap_header *)skb->data;
16261625
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
16271626
struct ieee80211_hdr *hdr;
16281627
struct ieee80211_sub_if_data *tmp_sdata, *sdata;
1628+
struct cfg80211_chan_def *chandef;
16291629
u16 len_rthdr;
16301630
int hdrlen;
16311631

@@ -1723,9 +1723,9 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
17231723
}
17241724

17251725
if (chanctx_conf)
1726-
chan = chanctx_conf->def.chan;
1726+
chandef = &chanctx_conf->def;
17271727
else if (!local->use_chanctx)
1728-
chan = local->_oper_chandef.chan;
1728+
chandef = &local->_oper_chandef;
17291729
else
17301730
goto fail_rcu;
17311731

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

1751-
ieee80211_xmit(sdata, skb, chan->band);
1752+
ieee80211_xmit(sdata, skb, chandef->chan->band);
17521753
rcu_read_unlock();
17531754

17541755
return NETDEV_TX_OK;

0 commit comments

Comments
 (0)