aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-01-20 07:55:25 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-06 14:50:37 -0500
commit95de817b9034d50860319f6033ec85d25024694c (patch)
tree8dc100ec6a5ee527a6e86b33e904f5f9d14181ab /net/mac80211/mlme.c
parent7852e36186d2a1983c215836d7e3d7b8927c930d (diff)
cfg80211: stop tracking authenticated state
To track authenticated state seems to have been a design mistake in cfg80211. It is possible to have out of band authentication (FT), tracking multiple authentications caused more problems than it ever helped, and the implementation in mac80211 is too complex. Remove all this complexity, and let userspace do whatever it wants to, mac80211 can deal with that just fine. Association is still tracked of course, but authentication no longer is. Local auth state changes are thus no longer of value, so ignore them completely. This will also help implement SAE -- asking the driver to do an authentication is now almost equivalent to sending an authentication frame, with the exception of shared key authentication which is still handled completely. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d04811a29cdf..082fcda57786 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2459,9 +2459,6 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
2459 struct ieee80211_work *wk; 2459 struct ieee80211_work *wk;
2460 u16 auth_alg; 2460 u16 auth_alg;
2461 2461
2462 if (req->local_state_change)
2463 return 0; /* no need to update mac80211 state */
2464
2465 switch (req->auth_type) { 2462 switch (req->auth_type) {
2466 case NL80211_AUTHTYPE_OPEN_SYSTEM: 2463 case NL80211_AUTHTYPE_OPEN_SYSTEM:
2467 auth_alg = WLAN_AUTH_OPEN; 2464 auth_alg = WLAN_AUTH_OPEN;
@@ -2593,7 +2590,7 @@ static enum work_done_result ieee80211_assoc_done(struct ieee80211_work *wk,
2593 sta_info_destroy_addr(wk->sdata, cbss->bssid); 2590 sta_info_destroy_addr(wk->sdata, cbss->bssid);
2594 } 2591 }
2595 2592
2596 cfg80211_send_rx_assoc(wk->sdata->dev, skb->data, skb->len); 2593 cfg80211_send_rx_assoc(wk->sdata->dev, cbss, skb->data, skb->len);
2597 destroy: 2594 destroy:
2598 if (wk->assoc.synced) 2595 if (wk->assoc.synced)
2599 drv_finish_tx_sync(local, wk->sdata, wk->filter_ta, 2596 drv_finish_tx_sync(local, wk->sdata, wk->filter_ta,
@@ -2750,13 +2747,12 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
2750{ 2747{
2751 struct ieee80211_local *local = sdata->local; 2748 struct ieee80211_local *local = sdata->local;
2752 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 2749 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2753 u8 bssid[ETH_ALEN];
2754 bool assoc_bss = false; 2750 bool assoc_bss = false;
2755 2751
2756 mutex_lock(&ifmgd->mtx); 2752 mutex_lock(&ifmgd->mtx);
2757 2753
2758 memcpy(bssid, req->bss->bssid, ETH_ALEN); 2754 if (ifmgd->associated &&
2759 if (ifmgd->associated == req->bss) { 2755 memcmp(ifmgd->associated->bssid, req->bssid, ETH_ALEN) == 0) {
2760 ieee80211_set_disassoc(sdata, false, true); 2756 ieee80211_set_disassoc(sdata, false, true);
2761 mutex_unlock(&ifmgd->mtx); 2757 mutex_unlock(&ifmgd->mtx);
2762 assoc_bss = true; 2758 assoc_bss = true;
@@ -2777,7 +2773,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
2777 tmp->type != IEEE80211_WORK_ASSOC_BEACON_WAIT) 2773 tmp->type != IEEE80211_WORK_ASSOC_BEACON_WAIT)
2778 continue; 2774 continue;
2779 2775
2780 if (memcmp(req->bss->bssid, tmp->filter_ta, ETH_ALEN)) 2776 if (memcmp(req->bssid, tmp->filter_ta, ETH_ALEN))
2781 continue; 2777 continue;
2782 2778
2783 not_auth_yet = tmp->type == IEEE80211_WORK_DIRECT_PROBE; 2779 not_auth_yet = tmp->type == IEEE80211_WORK_DIRECT_PROBE;
@@ -2811,18 +2807,15 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
2811 * frame, and if it's IDLE we have completed the auth 2807 * frame, and if it's IDLE we have completed the auth
2812 * process already. 2808 * process already.
2813 */ 2809 */
2814 if (not_auth_yet) { 2810 if (not_auth_yet)
2815 __cfg80211_auth_canceled(sdata->dev, bssid);
2816 return 0; 2811 return 0;
2817 }
2818 } 2812 }
2819 2813
2820 printk(KERN_DEBUG "%s: deauthenticating from %pM by local choice (reason=%d)\n", 2814 printk(KERN_DEBUG "%s: deauthenticating from %pM by local choice (reason=%d)\n",
2821 sdata->name, bssid, req->reason_code); 2815 sdata->name, req->bssid, req->reason_code);
2822 2816
2823 ieee80211_send_deauth_disassoc(sdata, bssid, IEEE80211_STYPE_DEAUTH, 2817 ieee80211_send_deauth_disassoc(sdata, req->bssid, IEEE80211_STYPE_DEAUTH,
2824 req->reason_code, cookie, 2818 req->reason_code, cookie, true);
2825 !req->local_state_change);
2826 if (assoc_bss) 2819 if (assoc_bss)
2827 sta_info_flush(sdata->local, sdata); 2820 sta_info_flush(sdata->local, sdata);
2828 2821