提交 d61d2e90 编写于 作者: S Stefano Brivio 提交者: Pablo Neira Ayuso

netfilter: nft_set_pipapo: Drop useless assignment of scratch map index on insert

In nft_pipapo_insert(), we need to reallocate scratch maps that will
be used for matching by lookup functions, if they have never been
allocated or if the bucket size changes as a result of the insertion.

As pipapo_realloc_scratch() provides a pair of fresh, zeroed out
maps, there's no need to select a particular one after reallocation.

Other than being useless, the existing assignment was also troubled
by the fact that the index was set only on the CPU performing the
actual insertion, as spotted by Florian.

Simply drop the assignment.
Reported-by: NFlorian Westphal <fw@strlen.de>
Fixes: 3c4287f6 ("nf_tables: Add set type for arbitrary concatenation of ranges")
Signed-off-by: NStefano Brivio <sbrivio@redhat.com>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 f53b9b0b
...@@ -1249,8 +1249,6 @@ static int nft_pipapo_insert(const struct net *net, const struct nft_set *set, ...@@ -1249,8 +1249,6 @@ static int nft_pipapo_insert(const struct net *net, const struct nft_set *set,
if (err) if (err)
return err; return err;
this_cpu_write(nft_pipapo_scratch_index, false);
m->bsize_max = bsize_max; m->bsize_max = bsize_max;
} else { } else {
put_cpu_ptr(m->scratch); put_cpu_ptr(m->scratch);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册