Commit efefd4f0 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_tables: missing iterator type in lookup walk

Add missing decorator type to lookup expression and tighten WARN_ON_ONCE
check in pipapo to spot earlier that this is unset.

Fixes: 29b359cf ("netfilter: nft_set_pipapo: walk over current view on netlink dump")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 75ce9506
...@@ -216,6 +216,7 @@ static int nft_lookup_validate(const struct nft_ctx *ctx, ...@@ -216,6 +216,7 @@ static int nft_lookup_validate(const struct nft_ctx *ctx,
return 0; return 0;
iter.genmask = nft_genmask_next(ctx->net); iter.genmask = nft_genmask_next(ctx->net);
iter.type = NFT_ITER_UPDATE;
iter.skip = 0; iter.skip = 0;
iter.count = 0; iter.count = 0;
iter.err = 0; iter.err = 0;
......
...@@ -2123,7 +2123,8 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set, ...@@ -2123,7 +2123,8 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
const struct nft_pipapo_field *f; const struct nft_pipapo_field *f;
unsigned int i, r; unsigned int i, r;
WARN_ON_ONCE(iter->type == NFT_ITER_UNSPEC); WARN_ON_ONCE(iter->type != NFT_ITER_READ &&
iter->type != NFT_ITER_UPDATE);
rcu_read_lock(); rcu_read_lock();
if (iter->type == NFT_ITER_READ) if (iter->type == NFT_ITER_READ)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment