aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2008-12-12 10:08:31 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 15:23:08 -0500
commitb8d476c8cb64a1640d8762aa442b8a73fa74b7d5 (patch)
tree0313f5af3f042abb8cf79fd9d188b3929fe80f16 /net/mac80211/cfg.c
parent0fe45b1debba7302155b62f3829119a1185a4f5a (diff)
mac80211: Send Layer 2 Update frame on reassociation
When a STA roams back to the same AP before the previous STA entry has expired, a new STA entry is not added in mac80211. However, a Layer 2 Update frame still needs to be transmitted to update layer 2 devices about the new location for the STA. Without this, switches may continue to forward frames to the previous (now incorrect) port when STA roams between APs. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 3ea0884c9432..9d4e4d846ec1 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -686,6 +686,7 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
686 struct sta_info *sta; 686 struct sta_info *sta;
687 struct ieee80211_sub_if_data *sdata; 687 struct ieee80211_sub_if_data *sdata;
688 int err; 688 int err;
689 int layer2_update;
689 690
690 /* Prevent a race with changing the rate control algorithm */ 691 /* Prevent a race with changing the rate control algorithm */
691 if (!netif_running(dev)) 692 if (!netif_running(dev))
@@ -716,17 +717,25 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
716 717
717 rate_control_rate_init(sta); 718 rate_control_rate_init(sta);
718 719
720 layer2_update = sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
721 sdata->vif.type == NL80211_IFTYPE_AP;
722
719 rcu_read_lock(); 723 rcu_read_lock();
720 724
721 err = sta_info_insert(sta); 725 err = sta_info_insert(sta);
722 if (err) { 726 if (err) {
723 /* STA has been freed */ 727 /* STA has been freed */
728 if (err == -EEXIST && layer2_update) {
729 /* Need to update layer 2 devices on reassociation */
730 sta = sta_info_get(local, mac);
731 if (sta)
732 ieee80211_send_layer2_update(sta);
733 }
724 rcu_read_unlock(); 734 rcu_read_unlock();
725 return err; 735 return err;
726 } 736 }
727 737
728 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN || 738 if (layer2_update)
729 sdata->vif.type == NL80211_IFTYPE_AP)
730 ieee80211_send_layer2_update(sta); 739 ieee80211_send_layer2_update(sta);
731 740
732 rcu_read_unlock(); 741 rcu_read_unlock();