summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2015-11-04 09:28:29 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2015-11-07 10:58:01 +0100
commit7623e1bcf0be0c65e2abc9a0dcd3ec606e501dc5 (patch)
treefaeac41256078f66097c7382962ca12f94373df0
parent30383a8bd324ea4579b2ed90295a3a147b67be61 (diff)
Fix hash:* type expiration
Incorrect index was used when the data blob was shrinked at expiration, which could lead to falsely expired entries and memory leak when the comment extension was used too. Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
-rw-r--r--kernel/net/netfilter/ipset/ip_set_hash_gen.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_hash_gen.h b/kernel/net/netfilter/ipset/ip_set_hash_gen.h
index 63a1733..d774059 100644
--- a/kernel/net/netfilter/ipset/ip_set_hash_gen.h
+++ b/kernel/net/netfilter/ipset/ip_set_hash_gen.h
@@ -512,7 +512,7 @@ mtype_expire(struct ip_set *set, struct htype *h)
continue;
data = ahash_data(n, j, dsize);
memcpy(tmp->value + d * dsize, data, dsize);
- set_bit(j, tmp->used);
+ set_bit(d, tmp->used);
d++;
}
tmp->pos = d;