summaryrefslogtreecommitdiffstats
path: root/sys/netinet/siftr.c
diff options
context:
space:
mode:
authorlstewart <lstewart@FreeBSD.org>2013-03-07 04:42:20 +0000
committerlstewart <lstewart@FreeBSD.org>2013-03-07 04:42:20 +0000
commit0d18b7b93ee1ed07a3c09dafb62c763c56e0ce17 (patch)
tree5b0b6d26643eeb76df069ac3080ee36025da5361 /sys/netinet/siftr.c
parentc959afb453be96e0fe238152f5fc13ff957ee574 (diff)
downloadFreeBSD-src-0d18b7b93ee1ed07a3c09dafb62c763c56e0ce17.zip
FreeBSD-src-0d18b7b93ee1ed07a3c09dafb62c763c56e0ce17.tar.gz
The hashmask returned by hashinit() is a valid index in the returned hash array.
Fix a siftr(4) potential memory leak and INVARIANTS triggered kernel panic in hashdestroy() by ensuring the last array index in the flow counter hash table is flushed of entries. MFC after: 3 days
Diffstat (limited to 'sys/netinet/siftr.c')
-rw-r--r--sys/netinet/siftr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c
index b0e111c..886be06 100644
--- a/sys/netinet/siftr.c
+++ b/sys/netinet/siftr.c
@@ -1314,7 +1314,7 @@ siftr_manage_ops(uint8_t action)
* flow seen and freeing any malloc'd memory.
* The hash consists of an array of LISTs (man 3 queue).
*/
- for (i = 0; i < siftr_hashmask; i++) {
+ for (i = 0; i <= siftr_hashmask; i++) {
LIST_FOREACH_SAFE(counter, counter_hash + i, nodes,
tmp_counter) {
key = counter->key;
OpenPOWER on IntegriCloud