summaryrefslogtreecommitdiff
path: root/sys/net80211
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2012-01-25 17:03:32 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2012-01-25 17:03:32 +0000
commitd98f0291e29639b07fe729b57bdd760c9d0e822b (patch)
tree559e41446e88c93b87017661a8bf26dc8abac608 /sys/net80211
parent62dccb38d83347fb9383fa49ef2ae22702e1ac87 (diff)
Clean inactive authenticated nodes during cache timeout as well.
There is no need to keep nodes cached with never associated and were inactive within the last 5 minutes or more. Keeps the node cache pretty clean in my environment with typical city-center wlan noise.
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_node.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index f4f580fa1ce..93757ee496f 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.66 2012/01/21 19:42:16 stsp Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.67 2012/01/25 17:03:31 stsp Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -1137,8 +1137,8 @@ ieee80211_free_allnodes(struct ieee80211com *ic)
* Timeout inactive nodes.
*
* If called because of a cache timeout, which happens only in hostap and ibss
- * modes, clean all inactive cached nodes but don't de-auth any authenticated
- * or associated nodes.
+ * modes, clean all inactive cached or authenticated nodes but don't de-auth
+ * any associated nodes.
*
* Else, this function is called because a new node must be allocated but the
* node cache is full. In this case, return as soon as a free slot was made
@@ -1170,7 +1170,7 @@ ieee80211_clean_nodes(struct ieee80211com *ic, int cache_timeout)
ic->ic_state == IEEE80211_S_RUN) {
if (cache_timeout) {
if (ni->ni_state != IEEE80211_STA_COLLECT &&
- (ni->ni_state >= IEEE80211_STA_AUTH ||
+ (ni->ni_state == IEEE80211_STA_ASSOC ||
ni->ni_inact < IEEE80211_INACT_MAX))
continue;
} else {