aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-04-23 08:02:30 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-04-23 10:40:40 -0400
commit60f4b626d5b5c5724b010200a8c2ff3169f6f4db (patch)
treefb4ac7171196117f229e235db3c0b20de099cb86
parent5eb8f4d74204864d8a4154772206ad747274d12d (diff)
mac80211: fix rhashtable conversion
My conversion of the mac80211 station hash table to rhashtable completely broke the lookup in sta_info_get() as it no longer took into account the virtual interface. Fix that. Fixes: 7bedd0cfad4e1 ("mac80211: use rhashtable for station table") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/sta_info.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 12971b71d0fa..39893178a1a9 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -157,8 +157,24 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
157 const u8 *addr) 157 const u8 *addr)
158{ 158{
159 struct ieee80211_local *local = sdata->local; 159 struct ieee80211_local *local = sdata->local;
160 struct sta_info *sta;
161 struct rhash_head *tmp;
162 const struct bucket_table *tbl;
163
164 rcu_read_lock();
165 tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash);
160 166
161 return rhashtable_lookup_fast(&local->sta_hash, addr, sta_rht_params); 167 for_each_sta_info(local, tbl, addr, sta, tmp) {
168 if (sta->sdata == sdata) {
169 rcu_read_unlock();
170 /* this is safe as the caller must already hold
171 * another rcu read section or the mutex
172 */
173 return sta;
174 }
175 }
176 rcu_read_unlock();
177 return NULL;
162} 178}
163 179
164/* 180/*