From 1e0e83d760a799bf7662acdee12fa254682a778b Mon Sep 17 00:00:00 2001 From: Lawrence Stewart Date: Thu, 7 Mar 2013 04:42:20 +0000 Subject: [PATCH] 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 --- sys/netinet/siftr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index b0e111ca3ac4..886be0685d1a 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;