Revert "netfilter: nft_set_pipapo: walk over current view on netlink dump"
This reverts commit 2bbac316e0
.
This commit is contained in:
parent
334f161f67
commit
724a6d6e06
3 changed files with 2 additions and 21 deletions
|
@ -262,22 +262,9 @@ struct nft_set_elem {
|
|||
void *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nft_iter_type - nftables set iterator type
|
||||
*
|
||||
* @NFT_ITER_READ: read-only iteration over set elements
|
||||
* @NFT_ITER_UPDATE: iteration under mutex to update set element state
|
||||
*/
|
||||
enum nft_iter_type {
|
||||
NFT_ITER_UNSPEC,
|
||||
NFT_ITER_READ,
|
||||
NFT_ITER_UPDATE,
|
||||
};
|
||||
|
||||
struct nft_set;
|
||||
struct nft_set_iter {
|
||||
u8 genmask;
|
||||
enum nft_iter_type type:8;
|
||||
unsigned int count;
|
||||
unsigned int skip;
|
||||
int err;
|
||||
|
|
|
@ -594,7 +594,6 @@ static void nft_map_deactivate(const struct nft_ctx *ctx, struct nft_set *set)
|
|||
{
|
||||
struct nft_set_iter iter = {
|
||||
.genmask = nft_genmask_next(ctx->net),
|
||||
.type = NFT_ITER_UPDATE,
|
||||
.fn = nft_mapelem_deactivate,
|
||||
};
|
||||
|
||||
|
@ -4778,7 +4777,6 @@ int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set,
|
|||
}
|
||||
|
||||
iter.genmask = nft_genmask_next(ctx->net);
|
||||
iter.type = NFT_ITER_UPDATE;
|
||||
iter.skip = 0;
|
||||
iter.count = 0;
|
||||
iter.err = 0;
|
||||
|
@ -4832,7 +4830,6 @@ static void nft_map_activate(const struct nft_ctx *ctx, struct nft_set *set)
|
|||
{
|
||||
struct nft_set_iter iter = {
|
||||
.genmask = nft_genmask_next(ctx->net),
|
||||
.type = NFT_ITER_UPDATE,
|
||||
.fn = nft_mapelem_activate,
|
||||
};
|
||||
|
||||
|
@ -5145,7 +5142,6 @@ static int nf_tables_dump_set(struct sk_buff *skb, struct netlink_callback *cb)
|
|||
args.cb = cb;
|
||||
args.skb = skb;
|
||||
args.iter.genmask = nft_genmask_cur(net);
|
||||
args.iter.type = NFT_ITER_READ;
|
||||
args.iter.skip = cb->args[0];
|
||||
args.iter.count = 0;
|
||||
args.iter.err = 0;
|
||||
|
@ -6069,7 +6065,6 @@ static int nf_tables_delsetelem(struct net *net, struct sock *nlsk,
|
|||
if (nla[NFTA_SET_ELEM_LIST_ELEMENTS] == NULL) {
|
||||
struct nft_set_iter iter = {
|
||||
.genmask = genmask,
|
||||
.type = NFT_ITER_UPDATE,
|
||||
.fn = nft_flush_set,
|
||||
};
|
||||
set->ops->walk(&ctx, set, &iter);
|
||||
|
|
|
@ -2026,14 +2026,13 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
|
|||
struct nft_set_iter *iter)
|
||||
{
|
||||
struct nft_pipapo *priv = nft_set_priv(set);
|
||||
struct net *net = read_pnet(&set->net);
|
||||
struct nft_pipapo_match *m;
|
||||
struct nft_pipapo_field *f;
|
||||
int i, r;
|
||||
|
||||
WARN_ON_ONCE(iter->type == NFT_ITER_UNSPEC);
|
||||
|
||||
rcu_read_lock();
|
||||
if (iter->type == NFT_ITER_READ)
|
||||
if (iter->genmask == nft_genmask_cur(net))
|
||||
m = rcu_dereference(priv->match);
|
||||
else
|
||||
m = priv->clone;
|
||||
|
|
Loading…
Add table
Reference in a new issue