aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2013-06-18 08:20:40 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-06-18 10:36:59 -0400
commit52874a5e3917dde3b081521b014d6e4b226aacff (patch)
treeffdba501488b103208892685240b29ac2513c7fc /net/mac80211
parent3aede78aad2a7e39a81b4b0caa771d40254a6787 (diff)
Revert "mac80211: in IBSS use the Auth frame to trigger STA reinsertion"
This reverts commit 6d810f10325522cfcf498dc6d64b9f96e1f5153f In this way an IBSS station will not use the AUTH messages to trigger a state reinitialisation anymore. The behaviour was racy and was not working properly. It has been introduced to help wpa_supplicant to support IBSS/RSN, however all the logic is now getting moved into wpa_s itself which will also be in charge of handling the AUTH messages thanks to the mgmt frame registration. If userspace does not register for receiving AUTH frames then mac80211 will still reply by itself. At the same time, the auth frame registration counter can be removed since it is not needed anymore. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> [remove unused variable] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c11
-rw-r--r--net/mac80211/ibss.c41
-rw-r--r--net/mac80211/ieee80211_i.h1
3 files changed, 7 insertions, 46 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 64cf294c2b96..18ba7ed3ef0b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2924,19 +2924,8 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy,
2924 u16 frame_type, bool reg) 2924 u16 frame_type, bool reg)
2925{ 2925{
2926 struct ieee80211_local *local = wiphy_priv(wiphy); 2926 struct ieee80211_local *local = wiphy_priv(wiphy);
2927 struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
2928 2927
2929 switch (frame_type) { 2928 switch (frame_type) {
2930 case IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH:
2931 if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
2932 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
2933
2934 if (reg)
2935 ifibss->auth_frame_registrations++;
2936 else
2937 ifibss->auth_frame_registrations--;
2938 }
2939 break;
2940 case IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ: 2929 case IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ:
2941 if (reg) 2930 if (reg)
2942 local->probe_req_reg++; 2931 local->probe_req_reg++;
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index eaacfd27061c..ea7b9c2c7e66 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -300,8 +300,7 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
300 tsf, false); 300 tsf, false);
301} 301}
302 302
303static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta, 303static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta)
304 bool auth)
305 __acquires(RCU) 304 __acquires(RCU)
306{ 305{
307 struct ieee80211_sub_if_data *sdata = sta->sdata; 306 struct ieee80211_sub_if_data *sdata = sta->sdata;
@@ -323,20 +322,12 @@ static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta,
323 /* If it fails, maybe we raced another insertion? */ 322 /* If it fails, maybe we raced another insertion? */
324 if (sta_info_insert_rcu(sta)) 323 if (sta_info_insert_rcu(sta))
325 return sta_info_get(sdata, addr); 324 return sta_info_get(sdata, addr);
326 if (auth && !sdata->u.ibss.auth_frame_registrations) {
327 ibss_dbg(sdata,
328 "TX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=1)\n",
329 sdata->vif.addr, addr, sdata->u.ibss.bssid);
330 ieee80211_send_auth(sdata, 1, WLAN_AUTH_OPEN, 0, NULL, 0,
331 addr, sdata->u.ibss.bssid, NULL, 0, 0, 0);
332 }
333 return sta; 325 return sta;
334} 326}
335 327
336static struct sta_info * 328static struct sta_info *
337ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, 329ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
338 const u8 *bssid, const u8 *addr, 330 const u8 *addr, u32 supp_rates)
339 u32 supp_rates, bool auth)
340 __acquires(RCU) 331 __acquires(RCU)
341{ 332{
342 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; 333 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
@@ -387,7 +378,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
387 sta->sta.supp_rates[band] = supp_rates | 378 sta->sta.supp_rates[band] = supp_rates |
388 ieee80211_mandatory_rates(sband); 379 ieee80211_mandatory_rates(sband);
389 380
390 return ieee80211_ibss_finish_sta(sta, auth); 381 return ieee80211_ibss_finish_sta(sta);
391} 382}
392 383
393static void ieee80211_rx_mgmt_deauth_ibss(struct ieee80211_sub_if_data *sdata, 384static void ieee80211_rx_mgmt_deauth_ibss(struct ieee80211_sub_if_data *sdata,
@@ -409,8 +400,6 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata,
409 size_t len) 400 size_t len)
410{ 401{
411 u16 auth_alg, auth_transaction; 402 u16 auth_alg, auth_transaction;
412 struct sta_info *sta;
413 u8 deauth_frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
414 403
415 sdata_assert_lock(sdata); 404 sdata_assert_lock(sdata);
416 405
@@ -427,22 +416,6 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata,
427 if (auth_alg != WLAN_AUTH_OPEN || auth_transaction != 1) 416 if (auth_alg != WLAN_AUTH_OPEN || auth_transaction != 1)
428 return; 417 return;
429 418
430 sta_info_destroy_addr(sdata, mgmt->sa);
431 sta = ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, 0, false);
432 rcu_read_unlock();
433
434 /*
435 * if we have any problem in allocating the new station, we reply with a
436 * DEAUTH frame to tell the other end that we had a problem
437 */
438 if (!sta) {
439 ieee80211_send_deauth_disassoc(sdata, sdata->u.ibss.bssid,
440 IEEE80211_STYPE_DEAUTH,
441 WLAN_REASON_UNSPECIFIED, true,
442 deauth_frame_buf);
443 return;
444 }
445
446 /* 419 /*
447 * IEEE 802.11 standard does not require authentication in IBSS 420 * IEEE 802.11 standard does not require authentication in IBSS
448 * networks and most implementations do not seem to use it. 421 * networks and most implementations do not seem to use it.
@@ -508,7 +481,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
508 } else { 481 } else {
509 rcu_read_unlock(); 482 rcu_read_unlock();
510 sta = ieee80211_ibss_add_sta(sdata, mgmt->bssid, 483 sta = ieee80211_ibss_add_sta(sdata, mgmt->bssid,
511 mgmt->sa, supp_rates, true); 484 mgmt->sa, supp_rates);
512 } 485 }
513 } 486 }
514 487
@@ -614,7 +587,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
614 ieee80211_sta_join_ibss(sdata, bss); 587 ieee80211_sta_join_ibss(sdata, bss);
615 supp_rates = ieee80211_sta_get_rates(local, elems, band, NULL); 588 supp_rates = ieee80211_sta_get_rates(local, elems, band, NULL);
616 ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, 589 ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa,
617 supp_rates, true); 590 supp_rates);
618 rcu_read_unlock(); 591 rcu_read_unlock();
619 } 592 }
620 593
@@ -986,7 +959,7 @@ void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata)
986 list_del(&sta->list); 959 list_del(&sta->list);
987 spin_unlock_bh(&ifibss->incomplete_lock); 960 spin_unlock_bh(&ifibss->incomplete_lock);
988 961
989 ieee80211_ibss_finish_sta(sta, true); 962 ieee80211_ibss_finish_sta(sta);
990 rcu_read_unlock(); 963 rcu_read_unlock();
991 spin_lock_bh(&ifibss->incomplete_lock); 964 spin_lock_bh(&ifibss->incomplete_lock);
992 } 965 }
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 1bfc3955005c..00d71e9a8fb8 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -498,7 +498,6 @@ struct ieee80211_if_ibss {
498 bool privacy; 498 bool privacy;
499 499
500 bool control_port; 500 bool control_port;
501 unsigned int auth_frame_registrations;
502 501
503 u8 bssid[ETH_ALEN] __aligned(2); 502 u8 bssid[ETH_ALEN] __aligned(2);
504 u8 ssid[IEEE80211_MAX_SSID_LEN]; 503 u8 ssid[IEEE80211_MAX_SSID_LEN];