summaryrefslogtreecommitdiff
path: root/sys/net80211
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2012-01-18 14:35:57 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2012-01-18 14:35:57 +0000
commit0d75d50837e73ebe4533f64ab89d15a207512bf5 (patch)
treef6dbc2f157a457ae3eaeb1bdc6c3e54d5c0b13b5 /sys/net80211
parent243dcd714d9afc87d2a7c269308d8d6066f69e5d (diff)
Don't unconditionally allocate new nodes in the hostap auth frame input path.
Check if the node was already cached first. Duplicate nodes aren't reachable from the node cache's RB tree, so they leak and mess up node cache accounting. As more and more nodes leak the global nodes counter keeps increasing, eventually reaching the limit and hovering there. The system then constantly tries to clean the node cache, sending de-auth frames to stations in the process, even if the actual number of associated stations is small. ok jsg@
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_proto.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 82af52bed16..c20b4e49c03 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_proto.c,v 1.45 2011/02/21 20:00:54 stsp Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.46 2012/01/18 14:35:56 stsp Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
@@ -702,7 +702,9 @@ ieee80211_auth_open(struct ieee80211com *ic, const struct ieee80211_frame *wh,
return;
}
if (ni == ic->ic_bss) {
- ni = ieee80211_alloc_node(ic, wh->i_addr2);
+ ni = ieee80211_find_node(ic, wh->i_addr2);
+ if (ni == NULL)
+ ni = ieee80211_alloc_node(ic, wh->i_addr2);
if (ni == NULL) {
return;
}