Skip to content

Commit 5d9bf13

Browse files
committed
netfilter: nft_set_pipapo: .walk does not deal with generations
JIRA: https://issues.redhat.com/browse/RHEL-1720 JIRA: https://issues.redhat.com/browse/RHEL-1721 Upstream Status: commit 2b84e21 commit 2b84e21 Author: Pablo Neira Ayuso <pablo@netfilter.org> Date: Fri Jun 16 15:20:04 2023 +0200 netfilter: nft_set_pipapo: .walk does not deal with generations The .walk callback iterates over the current active set, but it might be useful to iterate over the next generation set. Use the generation mask to determine what set view (either current or next generation) is use for the walk iteration. Fixes: 3c4287f ("nf_tables: Add set type for arbitrary concatenation of ranges") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fwestpha@redhat.com>
1 parent 3d294f8 commit 5d9bf13

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/netfilter/nft_set_pipapo.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,12 +1978,16 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
19781978
struct nft_set_iter *iter)
19791979
{
19801980
struct nft_pipapo *priv = nft_set_priv(set);
1981+
struct net *net = read_pnet(&set->net);
19811982
struct nft_pipapo_match *m;
19821983
struct nft_pipapo_field *f;
19831984
int i, r;
19841985

19851986
rcu_read_lock();
1986-
m = rcu_dereference(priv->match);
1987+
if (iter->genmask == nft_genmask_cur(net))
1988+
m = rcu_dereference(priv->match);
1989+
else
1990+
m = priv->clone;
19871991

19881992
if (unlikely(!m))
19891993
goto out;

0 commit comments

Comments
 (0)