Skip to contentSkip to conversation

mac80211: disassociate prior to unlinking AP/sta

RFC PATCH New Tomas Winkler 1 participant 1 message Nov 13, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 mac80211: disassociate prior to unlinking AP/sta

This patch reorders calls during disassociation in ieee80211_set_disassoc func.
Since sta_info_unlink calls sta_notify(REMOVE) it will remove the AP from the driver before it has disassociated from it (bss_info_changed).

---
 net/mac80211/mlme.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
net/mac80211/mlme.c +14 -4
index 60ef983..ae831ab 100644
@@ -857,16 +857,26 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 	if (self_disconnected)
 		ifsta->state = IEEE80211_STA_MLME_DISABLED;
 
-	sta_info_unlink(&sta);
-
 	rcu_read_unlock();
 
-	sta_info_destroy(sta);
-
 	local->hw.conf.ht.enabled = false;
 	ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_HT);
 
 	ieee80211_bss_info_change_notify(sdata, changed);
+
+	rcu_read_lock();
+
+	sta = sta_info_get(local, ifsta->bssid);
+	if (!sta) {
+		rcu_read_unlock();
+		return;
+	}
+
+	sta_info_unlink(&sta);
+
+	rcu_read_unlock();
+
+	sta_info_destroy(sta);
 }
 
 static int ieee80211_sta_wep_configured(struct ieee80211_sub_if_data *sdata)
Signature · 9 lines
1.5.4.3

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.