diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-02-02 16:47:54 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-02-02 16:47:54 +0000 |
commit | 42a68b32563b63e29e061549c26898a244be6289 (patch) | |
tree | 835e4b01763b42a91b9ec34d42664ebf68593a7b /sys/net80211/ieee80211_proto.c | |
parent | 9f3b9441ee4e915ee12b0f0e16212fefccf8127d (diff) |
Remove global counters from struct ieee80211com which track the number of
associated nodes with particular properties: 11b-only ("non-ERP") nodes,
nodes requiring long slot time, nodes using WPA, nodes not supporting 11n,
nodes currently dozing in powersave state, and nodes with a pending group
key update confirmation.
These counters weren't properly maintained.
There are bugs in the stack where these counters and actual node properties
got out of sync. This is exposed by panics which are supposed to help us
catch such bugs. But these panics don't provide real clues.
Instead of maintaining global counters forcing us to hunt refcounting bugs,
count nodes with the property in question on demand, by iterating over all
nodes and checking their state.
This is cheap since we'll never have more than 100 nodes cached, and none of
the cases where we need such information is in a performance critical path.
Prevents panics in hostap mode reported by Lauri Tirkkonen on bugs@ last
year (https://marc.info/?l=openbsd-bugs&m=147513817930489&w=2) and also
encountered by my 11n APs ("panic: bogus non-HT station count 0").
tested by Lauri, tb@, and myself
ok mpi@ tb@
Diffstat (limited to 'sys/net80211/ieee80211_proto.c')
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 4e48d76d010..b5d4055b847 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.70 2016/12/26 23:25:11 stsp Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.71 2017/02/02 16:47:53 stsp Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -309,8 +309,6 @@ void ieee80211_reset_erp(struct ieee80211com *ic) { ic->ic_flags &= ~IEEE80211_F_USEPROT; - ic->ic_nonerpsta = 0; - ic->ic_longslotsta = 0; /* * Enable short slot time iff: @@ -421,8 +419,6 @@ ieee80211_node_gtk_rekey(void *arg, struct ieee80211_node *ni) ni->ni_flags |= IEEE80211_NODE_REKEY; if (ieee80211_send_group_msg1(ic, ni) != 0) ni->ni_flags &= ~IEEE80211_NODE_REKEY; - else - ic->ic_rsn_keydonesta++; } /* @@ -457,7 +453,6 @@ ieee80211_setkeys(struct ieee80211com *ic) arc4random_buf(k->k_key, k->k_len); } - ic->ic_rsn_keydonesta = 0; ieee80211_iterate_nodes(ic, ieee80211_node_gtk_rekey, ic); } |