mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 23:04:54 +01:00
netfilter: ipset: Fix forceadd evaluation path
When the forceadd option is enabled, the hash:* types should find and replace
the first entry in the bucket with the new one if there are no reuseable
(deleted or timed out) entries. However, the position index was just not set
to zero and remained the invalid -1 if there were no reuseable entries.
Reported-by: [email protected]
Fixes: 23c42a403a ("netfilter: ipset: Introduction of new commands and protocol version 7")
Signed-off-by: Jozsef Kadlecsik <[email protected]>
This commit is contained in:
1 parent
f66ee0410b
commit
8af1c6fbd9
1 file changed
+2
@@ -931,6 +931,8 @@ mtype_add(struct ip_set *set, void *value, const struct ip_set_ext *ext,
|
||||
}
|
||||
}
|
||||
if (reuse || forceadd) {
|
||||
if (j == -1)
|
||||
j = 0;
|
||||
data = ahash_data(n, j, set->dsize);
|
||||
if (!deleted) {
|
||||
#ifdef IP_SET_HASH_WITH_NETS
|
||||
|
||||
Reference in new issue
Block a user