Skip to content

Commit

Permalink
mac80211: use oper_channel in ibss
Browse files Browse the repository at this point in the history
Using hw.conf.channel is wrong as it could be the
temporary channel if any function like the beacon
get function is called while scanning or during
other temporary out-of-channel activities.

Use oper_channel instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jul 31, 2012
1 parent 6962d60 commit 273686d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/mac80211/ibss.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
mod_timer(&ifibss->timer,
round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));

bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel,
bss = cfg80211_inform_bss_frame(local->hw.wiphy, chan,
mgmt, skb->len, 0, GFP_KERNEL);
cfg80211_put_bss(bss);
netif_carrier_on(sdata->dev);
Expand Down Expand Up @@ -294,7 +294,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
struct ieee80211_local *local = sdata->local;
struct sta_info *sta;
int band = local->hw.conf.channel->band;
int band = local->oper_channel->band;

/*
* XXX: Consider removing the least recently used entry and
Expand Down Expand Up @@ -561,7 +561,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
struct ieee80211_local *local = sdata->local;
struct sta_info *sta;
int band = local->hw.conf.channel->band;
int band = local->oper_channel->band;

/*
* XXX: Consider removing the least recently used entry and
Expand Down Expand Up @@ -759,7 +759,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
return;
}
sdata_info(sdata, "IBSS not allowed on %d MHz\n",
local->hw.conf.channel->center_freq);
local->oper_channel->center_freq);

/* No IBSS found - decrease scan interval and continue
* scanning. */
Expand Down

0 comments on commit 273686d

Please sign in to comment.