浏览代码

Fix bug: sometimes valid entries in hash:* types of sets were evicted

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

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Jozsef Kadlecsik 8 年之前
父节点
当前提交
50054a9223
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/netfilter/ipset/ip_set_hash_gen.h

+ 1 - 1
net/netfilter/ipset/ip_set_hash_gen.h

@@ -897,7 +897,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;