Commit b8d476c8 authored by Jouni Malinen's avatar Jouni Malinen Committed by John W. Linville

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: default avatarJouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0fe45b1d
...@@ -686,6 +686,7 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -686,6 +686,7 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
struct sta_info *sta; struct sta_info *sta;
struct ieee80211_sub_if_data *sdata; struct ieee80211_sub_if_data *sdata;
int err; int err;
int layer2_update;
/* Prevent a race with changing the rate control algorithm */ /* Prevent a race with changing the rate control algorithm */
if (!netif_running(dev)) if (!netif_running(dev))
...@@ -716,17 +717,25 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -716,17 +717,25 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
rate_control_rate_init(sta); rate_control_rate_init(sta);
layer2_update = sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
sdata->vif.type == NL80211_IFTYPE_AP;
rcu_read_lock(); rcu_read_lock();
err = sta_info_insert(sta); err = sta_info_insert(sta);
if (err) { if (err) {
/* STA has been freed */ /* STA has been freed */
if (err == -EEXIST && layer2_update) {
/* Need to update layer 2 devices on reassociation */
sta = sta_info_get(local, mac);
if (sta)
ieee80211_send_layer2_update(sta);
}
rcu_read_unlock(); rcu_read_unlock();
return err; return err;
} }
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN || if (layer2_update)
sdata->vif.type == NL80211_IFTYPE_AP)
ieee80211_send_layer2_update(sta); ieee80211_send_layer2_update(sta);
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment