]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nft_set_pipapo: Drop useless assignment of scratch map index on insert
authorStefano Brivio <sbrivio@redhat.com>
Sun, 14 Jun 2020 21:42:07 +0000 (23:42 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Jun 2020 16:25:07 +0000 (18:25 +0200)
commit88f52bd26f002e286afd48d357d86e3e85992a1a
tree7a5a5bf4ffe0be7775a9630908ed52b5882c814f
parent15298db1a0484d8a61a9ca100373d35eca193f6c
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: Florian Westphal <fw@strlen.de>
Fixes: 81037b76e5aa ("nf_tables: Add set type for arbitrary concatenation of ranges")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_set_pipapo.c