aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-23 08:29:21 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-07-31 10:18:51 -0400
commit6962d602056c88ce470f991a265a33132fb95232 (patch)
tree7633bdfa5fe461bace0f9f265ad6ad12b569c5ef /net
parentb17166a707e748ad87907f38431a1df26bb643f2 (diff)
mac80211: use oper_channel in mesh
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>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mesh.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 6fac18c0423..03f1696d7d9 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -349,17 +349,18 @@ int mesh_add_ds_params_ie(struct sk_buff *skb,
349{ 349{
350 struct ieee80211_local *local = sdata->local; 350 struct ieee80211_local *local = sdata->local;
351 struct ieee80211_supported_band *sband; 351 struct ieee80211_supported_band *sband;
352 struct ieee80211_channel *chan = local->oper_channel;
352 u8 *pos; 353 u8 *pos;
353 354
354 if (skb_tailroom(skb) < 3) 355 if (skb_tailroom(skb) < 3)
355 return -ENOMEM; 356 return -ENOMEM;
356 357
357 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 358 sband = local->hw.wiphy->bands[chan->band];
358 if (sband->band == IEEE80211_BAND_2GHZ) { 359 if (sband->band == IEEE80211_BAND_2GHZ) {
359 pos = skb_put(skb, 2 + 1); 360 pos = skb_put(skb, 2 + 1);
360 *pos++ = WLAN_EID_DS_PARAMS; 361 *pos++ = WLAN_EID_DS_PARAMS;
361 *pos++ = 1; 362 *pos++ = 1;
362 *pos++ = ieee80211_frequency_to_channel(local->hw.conf.channel->center_freq); 363 *pos++ = ieee80211_frequency_to_channel(chan->center_freq);
363 } 364 }
364 365
365 return 0; 366 return 0;
@@ -603,7 +604,7 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
603 sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL; 604 sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL;
604 sdata->vif.bss_conf.basic_rates = 605 sdata->vif.bss_conf.basic_rates =
605 ieee80211_mandatory_rates(sdata->local, 606 ieee80211_mandatory_rates(sdata->local,
606 sdata->local->hw.conf.channel->band); 607 sdata->local->oper_channel->band);
607 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON | 608 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON |
608 BSS_CHANGED_BEACON_ENABLED | 609 BSS_CHANGED_BEACON_ENABLED |
609 BSS_CHANGED_HT | 610 BSS_CHANGED_HT |