aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-12-14 06:20:31 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-15 14:46:34 -0500
commit29623892e185b65a503c925236ff73894a842d38 (patch)
treea159e711035d4003ea64b52d3601a0be6f77e61b /net/mac80211/sta_info.c
parentd9a7ddb05e5419ca5e4b54f57074dc33c7ea991c (diff)
mac80211: count authorized stations per BSS
Currently, each AP interface will send multicast traffic if any interface has a station entry even if that station entry is allocated only. With the new station state management we can easily fix it by adding a counter that counts each authorized station only and send multicast traffic only when the correct interface has at least one authorized station. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index b22775cdcdf..141315ce17d 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1567,17 +1567,21 @@ int sta_info_move_state_checked(struct sta_info *sta,
1567 return -EINVAL; 1567 return -EINVAL;
1568 break; 1568 break;
1569 case IEEE80211_STA_ASSOC: 1569 case IEEE80211_STA_ASSOC:
1570 if (sta->sta_state == IEEE80211_STA_AUTH) 1570 if (sta->sta_state == IEEE80211_STA_AUTH) {
1571 set_bit(WLAN_STA_ASSOC, &sta->_flags); 1571 set_bit(WLAN_STA_ASSOC, &sta->_flags);
1572 else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) 1572 } else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) {
1573 if (sta->sdata->vif.type == NL80211_IFTYPE_AP)
1574 atomic_dec(&sta->sdata->u.ap.num_sta_authorized);
1573 clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags); 1575 clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags);
1574 else 1576 } else
1575 return -EINVAL; 1577 return -EINVAL;
1576 break; 1578 break;
1577 case IEEE80211_STA_AUTHORIZED: 1579 case IEEE80211_STA_AUTHORIZED:
1578 if (sta->sta_state == IEEE80211_STA_ASSOC) 1580 if (sta->sta_state == IEEE80211_STA_ASSOC) {
1581 if (sta->sdata->vif.type == NL80211_IFTYPE_AP)
1582 atomic_inc(&sta->sdata->u.ap.num_sta_authorized);
1579 set_bit(WLAN_STA_AUTHORIZED, &sta->_flags); 1583 set_bit(WLAN_STA_AUTHORIZED, &sta->_flags);
1580 else 1584 } else
1581 return -EINVAL; 1585 return -EINVAL;
1582 break; 1586 break;
1583 default: 1587 default: