diff options
author | Andrei Otcheretianski <andrei.otcheretianski@intel.com> | 2015-10-25 11:59:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-09 22:34:20 +0300 |
commit | 328a2865479c18995902c9be3ff754cd4a91845d (patch) | |
tree | afba444d6705818ba6f22224de302bc7c67c0058 /net/mac80211 | |
parent | 7631e903a6bd10e1eba646393991d36501382511 (diff) | |
download | linux-328a2865479c18995902c9be3ff754cd4a91845d.tar.xz |
mac80211: Fix local deauth while associating
commit a64cba3c5330704a034bd3179270b8d04daf6987 upstream.
Local request to deauthenticate wasn't handled while associating, thus
the association could continue even when the user space required to
disconnect.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mlme.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index cd7e55e08a23..af86975b35da 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -5028,6 +5028,25 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, return 0; } + if (ifmgd->assoc_data && + ether_addr_equal(ifmgd->assoc_data->bss->bssid, req->bssid)) { + sdata_info(sdata, + "aborting association with %pM by local choice (Reason: %u=%s)\n", + req->bssid, req->reason_code, + ieee80211_get_reason_code_string(req->reason_code)); + + drv_mgd_prepare_tx(sdata->local, sdata); + ieee80211_send_deauth_disassoc(sdata, req->bssid, + IEEE80211_STYPE_DEAUTH, + req->reason_code, tx, + frame_buf); + ieee80211_destroy_assoc_data(sdata, false); + ieee80211_report_disconnect(sdata, frame_buf, + sizeof(frame_buf), true, + req->reason_code); + return 0; + } + if (ifmgd->associated && ether_addr_equal(ifmgd->associated->bssid, req->bssid)) { sdata_info(sdata, |