aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-08 05:05:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-11 15:53:35 -0400
commit5bda617576e58c7213aef5ab90383f303727b5b1 (patch)
tree010bceb4b2d6f3a5c78e497a333eb64dac0f0473
parentfe3fa827314b877486c515a001c3e6f604f6f16f (diff)
mac80211: BSS info: check channel first
When we receive information about a BSS we check at some point whether or not we think we're allowed to use the channel it is on, but we do that fairly late. I don't think we should do it that late, so do it earlier to avoid doing IBSS/mesh stuff on that channel and then getting confused because it's disabled. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/mlme.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index a03245255ed0..ae97d7e9945d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2602,7 +2602,15 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
2602 DECLARE_MAC_BUF(mac); 2602 DECLARE_MAC_BUF(mac);
2603 DECLARE_MAC_BUF(mac2); 2603 DECLARE_MAC_BUF(mac2);
2604 2604
2605 beacon_timestamp = le64_to_cpu(mgmt->u.beacon.timestamp); 2605 if (elems->ds_params && elems->ds_params_len == 1)
2606 freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
2607 else
2608 freq = rx_status->freq;
2609
2610 channel = ieee80211_get_channel(local->hw.wiphy, freq);
2611
2612 if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
2613 return;
2606 2614
2607 if (ieee80211_vif_is_mesh(&sdata->vif) && elems->mesh_id && 2615 if (ieee80211_vif_is_mesh(&sdata->vif) && elems->mesh_id &&
2608 elems->mesh_config && mesh_matches_local(elems, sdata)) { 2616 elems->mesh_config && mesh_matches_local(elems, sdata)) {
@@ -2645,16 +2653,6 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
2645 rcu_read_unlock(); 2653 rcu_read_unlock();
2646 } 2654 }
2647 2655
2648 if (elems->ds_params && elems->ds_params_len == 1)
2649 freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
2650 else
2651 freq = rx_status->freq;
2652
2653 channel = ieee80211_get_channel(local->hw.wiphy, freq);
2654
2655 if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
2656 return;
2657
2658#ifdef CONFIG_MAC80211_MESH 2656#ifdef CONFIG_MAC80211_MESH
2659 if (elems->mesh_config) 2657 if (elems->mesh_config)
2660 bss = ieee80211_rx_mesh_bss_get(local, elems->mesh_id, 2658 bss = ieee80211_rx_mesh_bss_get(local, elems->mesh_id,
@@ -2723,6 +2721,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
2723 2721
2724 bss->band = band; 2722 bss->band = band;
2725 2723
2724 beacon_timestamp = le64_to_cpu(mgmt->u.beacon.timestamp);
2725
2726 bss->timestamp = beacon_timestamp; 2726 bss->timestamp = beacon_timestamp;
2727 bss->last_update = jiffies; 2727 bss->last_update = jiffies;
2728 bss->signal = rx_status->signal; 2728 bss->signal = rx_status->signal;