From: Tomas Winkler Date: Mon, 8 Sep 2008 15:33:38 +0000 (+0200) Subject: mac80211: disassociate when moving to new BSS X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3b7ee69d0caefbdb85a606a98bff841b8c63b97e;p=openwrt%2Fstaging%2Fblogic.git mac80211: disassociate when moving to new BSS This patch makes the MLME cleanly disassociate from the current BSS when leaving it for a new one. This is not just nicer to the old AP (we're leaving it, might as well tell it!) but also required for some drivers that keep track of the station we're associated with, they'd get confused because they'd think we are associated with two APs. Signed-off-by: Ron Rindjunsky Signed-off-by: Tomas Winkler Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index f7a390ff9679..eababf320b83 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3271,9 +3271,14 @@ void ieee80211_sta_req_auth(struct ieee80211_sub_if_data *sdata, return; if ((ifsta->flags & (IEEE80211_STA_BSSID_SET | - IEEE80211_STA_AUTO_BSSID_SEL)) && + IEEE80211_STA_AUTO_BSSID_SEL)) && (ifsta->flags & (IEEE80211_STA_SSID_SET | - IEEE80211_STA_AUTO_SSID_SEL))) { + IEEE80211_STA_AUTO_SSID_SEL))) { + + if (ifsta->state == IEEE80211_STA_MLME_ASSOCIATED) + ieee80211_set_disassoc(sdata, ifsta, true, true, + WLAN_REASON_DEAUTH_LEAVING); + set_bit(IEEE80211_STA_REQ_AUTH, &ifsta->request); queue_work(local->hw.workqueue, &ifsta->work); }