Skip to content

Commit

Permalink
mac80211: really fix monitor mode channel reporting
Browse files Browse the repository at this point in the history
After Felix's patch it was still broken in case you
used more than just a single monitor interface. Fix
it better now.

Reported-by: Sujith Manoharan <sujith@msujith.org>
Tested-by: Sujith Manoharan <sujith@msujith.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Feb 28, 2013
1 parent d0ae708 commit feda302
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3290,14 +3290,19 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
int ret = -ENODATA;

rcu_read_lock();
if (local->use_chanctx) {
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
if (chanctx_conf) {
*chandef = chanctx_conf->def;
ret = 0;
}
} else if (local->open_count == local->monitors) {
*chandef = local->monitor_chandef;
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
if (chanctx_conf) {
*chandef = chanctx_conf->def;
ret = 0;
} else if (local->open_count > 0 &&
local->open_count == local->monitors &&
sdata->vif.type == NL80211_IFTYPE_MONITOR) {
if (local->use_chanctx)
*chandef = local->monitor_chandef;
else
cfg80211_chandef_create(chandef,
local->_oper_channel,
local->_oper_channel_type);
ret = 0;
}
rcu_read_unlock();
Expand Down

0 comments on commit feda302

Please sign in to comment.