aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-04-23 13:49:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-24 14:54:28 -0400
commit7e3ed02c6e65a0cb4c9259c0d34740305d9aa5e7 (patch)
tree47a2a239639feaafd89729224d9e26492bb4eccd /net/mac80211/sta_info.c
parent030ef8f8a59c77d44cadeded6d3a5a12557774f4 (diff)
mac80211: fix num_mcast_sta counting issues
Moving a STA to an AP VLAN prevents num_mcast_sta from being decremented once the STA leaves, because sta->sdata changes. Fix this by checking for AP VLANs as well. Also exclude 4-addr VLAN stations from num_mcast_sta - remote 4-addr stations ignore 3-address multicast frames anyway. In a typical bridge configuration they receive the same packets as 4-address unicast. This patch also fixes clearing the sdata->u.vlan.sta pointer when the STA is removed from a 4-addr VLAN. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 4c04eb5e4cae..97a9d6639fb9 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1417,15 +1417,19 @@ int sta_info_move_state(struct sta_info *sta,
1417 if (sta->sta_state == IEEE80211_STA_AUTH) { 1417 if (sta->sta_state == IEEE80211_STA_AUTH) {
1418 set_bit(WLAN_STA_ASSOC, &sta->_flags); 1418 set_bit(WLAN_STA_ASSOC, &sta->_flags);
1419 } else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { 1419 } else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) {
1420 if (sta->sdata->vif.type == NL80211_IFTYPE_AP) 1420 if (sta->sdata->vif.type == NL80211_IFTYPE_AP ||
1421 atomic_dec(&sta->sdata->u.ap.num_mcast_sta); 1421 (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
1422 !sta->sdata->u.vlan.sta))
1423 atomic_dec(&sta->sdata->bss->num_mcast_sta);
1422 clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags); 1424 clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags);
1423 } 1425 }
1424 break; 1426 break;
1425 case IEEE80211_STA_AUTHORIZED: 1427 case IEEE80211_STA_AUTHORIZED:
1426 if (sta->sta_state == IEEE80211_STA_ASSOC) { 1428 if (sta->sta_state == IEEE80211_STA_ASSOC) {
1427 if (sta->sdata->vif.type == NL80211_IFTYPE_AP) 1429 if (sta->sdata->vif.type == NL80211_IFTYPE_AP ||
1428 atomic_inc(&sta->sdata->u.ap.num_mcast_sta); 1430 (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
1431 !sta->sdata->u.vlan.sta))
1432 atomic_inc(&sta->sdata->bss->num_mcast_sta);
1429 set_bit(WLAN_STA_AUTHORIZED, &sta->_flags); 1433 set_bit(WLAN_STA_AUTHORIZED, &sta->_flags);
1430 } 1434 }
1431 break; 1435 break;