@@ -44,6 +44,8 @@ void ieee80211_configure_filter(struct ieee80211_local *local)
u64 mc;
unsigned int changed_flags;
unsigned int new_flags = 0;
+ int avifs = 0;
+ struct ieee80211_sub_if_data *sdata;
if (atomic_read(&local->iff_promiscs))
new_flags |= FIF_PROMISC_IN_BSS;
@@ -78,6 +80,22 @@ void ieee80211_configure_filter(struct ieee80211_local *local)
/* be a bit nasty */
new_flags |= (1<<31);
+ /* If we have more than one virtual station, turn on PROMISC_IN_BSS
+ * --Ben
+ */
+ list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+ if (!sdata->dev || !netif_running(sdata->dev))
+ continue;
+
+ if (sdata->vif.type == NL80211_IFTYPE_STATION) {
+ avifs++;
+ if (avifs > 1)
+ break;
+ }
+ }
+ if (avifs > 1)
+ new_flags |= FIF_PROMISC_IN_BSS;
+
drv_configure_filter(local, changed_flags, &new_flags, mc);
WARN_ON(new_flags & (1<<31));
@@ -440,7 +440,7 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU)
spin_lock_irqsave(&local->sta_lock, flags);
/* check if STA exists already */
- if (sta_info_get_bss(sdata, sta->sta.addr)) {
+ if (sta_info_get(sdata, sta->sta.addr)) {
spin_unlock_irqrestore(&local->sta_lock, flags);
mutex_unlock(&local->sta_mtx);
rcu_read_lock();