summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-08-15 15:39:54 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-09-22 09:21:23 -0400
commit46cad4b7a131a215159d889fa88d0dc71d581908 (patch)
treec54192f676ee8c081722e07539625a155ddea585 /net/mac80211/mlme.c
parente3abc8ff0fc18b3925fd5d5c5fbd1613856f4e7c (diff)
mac80211: remove direct probe step before authentication
The direct probe step before authentication was done mostly for two reasons: 1) the BSS data could be stale 2) the beacon might not have included all IEs The concern (1) doesn't really seem to be relevant any more as we time out BSS information after about 30 seconds, and in fact the original patch only did the direct probe if the data was older than the BSS timeout to begin with. This condition got (likely inadvertedly) removed later though. Analysing this in more detail shows that since we mostly use data from the association response, the only real reason for needing the probe response was that the code validates the WMM parameters, and those are optional in beacons. As the previous patches removed that behaviour, we can now remove the direct probe step entirely. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c82
1 files changed, 23 insertions, 59 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 705ef1d040ed..6daadf2cd10b 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3262,16 +3262,6 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata,
3262 if (ifmgd->associated && 3262 if (ifmgd->associated &&
3263 ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid)) 3263 ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid))
3264 ieee80211_reset_ap_probe(sdata); 3264 ieee80211_reset_ap_probe(sdata);
3265
3266 if (ifmgd->auth_data && !ifmgd->auth_data->bss->proberesp_ies &&
3267 ether_addr_equal(mgmt->bssid, ifmgd->auth_data->bss->bssid)) {
3268 /* got probe response, continue with auth */
3269 sdata_info(sdata, "direct probe responded\n");
3270 ifmgd->auth_data->tries = 0;
3271 ifmgd->auth_data->timeout = jiffies;
3272 ifmgd->auth_data->timeout_started = true;
3273 run_again(sdata, ifmgd->auth_data->timeout);
3274 }
3275} 3265}
3276 3266
3277/* 3267/*
@@ -3717,12 +3707,14 @@ static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata,
3717 reason); 3707 reason);
3718} 3708}
3719 3709
3720static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata) 3710static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
3721{ 3711{
3722 struct ieee80211_local *local = sdata->local; 3712 struct ieee80211_local *local = sdata->local;
3723 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 3713 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
3724 struct ieee80211_mgd_auth_data *auth_data = ifmgd->auth_data; 3714 struct ieee80211_mgd_auth_data *auth_data = ifmgd->auth_data;
3725 u32 tx_flags = 0; 3715 u32 tx_flags = 0;
3716 u16 trans = 1;
3717 u16 status = 0;
3726 3718
3727 sdata_assert_lock(sdata); 3719 sdata_assert_lock(sdata);
3728 3720
@@ -3746,54 +3738,27 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata)
3746 3738
3747 drv_mgd_prepare_tx(local, sdata); 3739 drv_mgd_prepare_tx(local, sdata);
3748 3740
3749 if (auth_data->bss->proberesp_ies) { 3741 sdata_info(sdata, "send auth to %pM (try %d/%d)\n",
3750 u16 trans = 1; 3742 auth_data->bss->bssid, auth_data->tries,
3751 u16 status = 0; 3743 IEEE80211_AUTH_MAX_TRIES);
3752
3753 sdata_info(sdata, "send auth to %pM (try %d/%d)\n",
3754 auth_data->bss->bssid, auth_data->tries,
3755 IEEE80211_AUTH_MAX_TRIES);
3756
3757 auth_data->expected_transaction = 2;
3758 3744
3759 if (auth_data->algorithm == WLAN_AUTH_SAE) { 3745 auth_data->expected_transaction = 2;
3760 trans = auth_data->sae_trans;
3761 status = auth_data->sae_status;
3762 auth_data->expected_transaction = trans;
3763 }
3764 3746
3765 if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) 3747 if (auth_data->algorithm == WLAN_AUTH_SAE) {
3766 tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | 3748 trans = auth_data->sae_trans;
3767 IEEE80211_TX_INTFL_MLME_CONN_TX; 3749 status = auth_data->sae_status;
3768 3750 auth_data->expected_transaction = trans;
3769 ieee80211_send_auth(sdata, trans, auth_data->algorithm, status, 3751 }
3770 auth_data->data, auth_data->data_len,
3771 auth_data->bss->bssid,
3772 auth_data->bss->bssid, NULL, 0, 0,
3773 tx_flags);
3774 } else {
3775 const u8 *ssidie;
3776 3752
3777 sdata_info(sdata, "direct probe to %pM (try %d/%i)\n", 3753 if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS))
3778 auth_data->bss->bssid, auth_data->tries, 3754 tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS |
3779 IEEE80211_AUTH_MAX_TRIES); 3755 IEEE80211_TX_INTFL_MLME_CONN_TX;
3780 3756
3781 rcu_read_lock(); 3757 ieee80211_send_auth(sdata, trans, auth_data->algorithm, status,
3782 ssidie = ieee80211_bss_get_ie(auth_data->bss, WLAN_EID_SSID); 3758 auth_data->data, auth_data->data_len,
3783 if (!ssidie) { 3759 auth_data->bss->bssid,
3784 rcu_read_unlock(); 3760 auth_data->bss->bssid, NULL, 0, 0,
3785 return -EINVAL; 3761 tx_flags);
3786 }
3787 /*
3788 * Direct probe is sent to broadcast address as some APs
3789 * will not answer to direct packet in unassociated state.
3790 */
3791 ieee80211_send_probe_req(sdata, sdata->vif.addr, NULL,
3792 ssidie + 2, ssidie[1],
3793 NULL, 0, (u32) -1, true, 0,
3794 auth_data->bss->channel, false);
3795 rcu_read_unlock();
3796 }
3797 3762
3798 if (tx_flags == 0) { 3763 if (tx_flags == 0) {
3799 auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; 3764 auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
@@ -3874,8 +3839,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
3874 bool status_acked = ifmgd->status_acked; 3839 bool status_acked = ifmgd->status_acked;
3875 3840
3876 ifmgd->status_received = false; 3841 ifmgd->status_received = false;
3877 if (ifmgd->auth_data && 3842 if (ifmgd->auth_data && ieee80211_is_auth(fc)) {
3878 (ieee80211_is_probe_req(fc) || ieee80211_is_auth(fc))) {
3879 if (status_acked) { 3843 if (status_acked) {
3880 ifmgd->auth_data->timeout = 3844 ifmgd->auth_data->timeout =
3881 jiffies + IEEE80211_AUTH_TIMEOUT_SHORT; 3845 jiffies + IEEE80211_AUTH_TIMEOUT_SHORT;
@@ -3906,7 +3870,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
3906 * so let's just kill the auth data 3870 * so let's just kill the auth data
3907 */ 3871 */
3908 ieee80211_destroy_auth_data(sdata, false); 3872 ieee80211_destroy_auth_data(sdata, false);
3909 } else if (ieee80211_probe_auth(sdata)) { 3873 } else if (ieee80211_auth(sdata)) {
3910 u8 bssid[ETH_ALEN]; 3874 u8 bssid[ETH_ALEN];
3911 struct ieee80211_event event = { 3875 struct ieee80211_event event = {
3912 .type = MLME_EVENT, 3876 .type = MLME_EVENT,
@@ -4597,7 +4561,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
4597 if (err) 4561 if (err)
4598 goto err_clear; 4562 goto err_clear;
4599 4563
4600 err = ieee80211_probe_auth(sdata); 4564 err = ieee80211_auth(sdata);
4601 if (err) { 4565 if (err) {
4602 sta_info_destroy_addr(sdata, req->bss->bssid); 4566 sta_info_destroy_addr(sdata, req->bss->bssid);
4603 goto err_clear; 4567 goto err_clear;