Skip to content

Commit 2b84e21

Browse files
committed
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 <[email protected]>
1 parent 628bd3e commit 2b84e21

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
@@ -1974,12 +1974,16 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
19741974
struct nft_set_iter *iter)
19751975
{
19761976
struct nft_pipapo *priv = nft_set_priv(set);
1977+
struct net *net = read_pnet(&set->net);
19771978
struct nft_pipapo_match *m;
19781979
struct nft_pipapo_field *f;
19791980
int i, r;
19801981

19811982
rcu_read_lock();
1982-
m = rcu_dereference(priv->match);
1983+
if (iter->genmask == nft_genmask_cur(net))
1984+
m = rcu_dereference(priv->match);
1985+
else
1986+
m = priv->clone;
19831987

19841988
if (unlikely(!m))
19851989
goto out;

0 commit comments

Comments
 (0)