]> granicus.if.org Git - ipset/commitdiff
Fix hash:* type expiration
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 4 Nov 2015 08:28:29 +0000 (09:28 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Sat, 7 Nov 2015 09:58:01 +0000 (10:58 +0100)
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>
kernel/net/netfilter/ipset/ip_set_hash_gen.h

index 63a1733b0fdac5df97f8f17b278fd255995f7460..d774059a60c6ffe698b16dfd5aa6ebb9ec7ddcea 100644 (file)
@@ -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;