]> granicus.if.org Git - ipset/commitdiff
Fix bug: sometimes valid entries in hash:* types of sets were evicted
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 16 Feb 2017 19:47:30 +0000 (20:47 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 16 Feb 2017 19:47:30 +0000 (20:47 +0100)
Wrong index was used and therefore when shrinking a hash bucket at
deleting an entry, valid entries could be evicted as well.
Thanks to Eric Ewanco for the thorough bugreport.

Fixes netfilter bugzilla #1119

kernel/net/netfilter/ipset/ip_set_hash_gen.h

index 673c7aafa2a892b7054b294f082cdafdaec5c632..f66cad20653ca7f6d312138fbbc61347c81c96d6 100644 (file)
@@ -898,7 +898,7 @@ mtype_del(struct ip_set *set, void *value, const struct ip_set_ext *ext,
                                        continue;
                                data = ahash_data(n, j, dsize);
                                memcpy(tmp->value + k * dsize, data, dsize);
-                               set_bit(j, tmp->used);
+                               set_bit(k, tmp->used);
                                k++;
                        }
                        tmp->pos = k;