aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/ibss.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 5e6836c3aa4c..e08387cdc8fd 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -30,6 +30,7 @@
30 30
31#define IEEE80211_IBSS_MERGE_INTERVAL (30 * HZ) 31#define IEEE80211_IBSS_MERGE_INTERVAL (30 * HZ)
32#define IEEE80211_IBSS_INACTIVITY_LIMIT (60 * HZ) 32#define IEEE80211_IBSS_INACTIVITY_LIMIT (60 * HZ)
33#define IEEE80211_IBSS_RSN_INACTIVITY_LIMIT (10 * HZ)
33 34
34#define IEEE80211_IBSS_MAX_STA_ENTRIES 128 35#define IEEE80211_IBSS_MAX_STA_ENTRIES 128
35 36
@@ -740,6 +741,33 @@ static int ieee80211_sta_active_ibss(struct ieee80211_sub_if_data *sdata)
740 return active; 741 return active;
741} 742}
742 743
744static void ieee80211_ibss_sta_expire(struct ieee80211_sub_if_data *sdata)
745{
746 struct ieee80211_local *local = sdata->local;
747 struct sta_info *sta, *tmp;
748 unsigned long exp_time = IEEE80211_IBSS_INACTIVITY_LIMIT;
749 unsigned long exp_rsn_time = IEEE80211_IBSS_RSN_INACTIVITY_LIMIT;
750
751 mutex_lock(&local->sta_mtx);
752
753 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
754 if (sdata != sta->sdata)
755 continue;
756
757 if (time_after(jiffies, sta->last_rx + exp_time) ||
758 (time_after(jiffies, sta->last_rx + exp_rsn_time) &&
759 sta->sta_state != IEEE80211_STA_AUTHORIZED)) {
760 sta_dbg(sta->sdata, "expiring inactive %sSTA %pM\n",
761 sta->sta_state != IEEE80211_STA_AUTHORIZED ?
762 "not authorized " : "", sta->sta.addr);
763
764 WARN_ON(__sta_info_destroy(sta));
765 }
766 }
767
768 mutex_unlock(&local->sta_mtx);
769}
770
743/* 771/*
744 * This function is called with state == IEEE80211_IBSS_MLME_JOINED 772 * This function is called with state == IEEE80211_IBSS_MLME_JOINED
745 */ 773 */
@@ -754,7 +782,7 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata)
754 mod_timer(&ifibss->timer, 782 mod_timer(&ifibss->timer,
755 round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL)); 783 round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));
756 784
757 ieee80211_sta_expire(sdata, IEEE80211_IBSS_INACTIVITY_LIMIT); 785 ieee80211_ibss_sta_expire(sdata);
758 786
759 if (time_before(jiffies, ifibss->last_scan_completed + 787 if (time_before(jiffies, ifibss->last_scan_completed +
760 IEEE80211_IBSS_MERGE_INTERVAL)) 788 IEEE80211_IBSS_MERGE_INTERVAL))