Commit 5cb82a38 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_tables: pass netns to set->ops->remove()

This new parameter is required by the new bitmap set type that comes in a
follow up patch.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent c078ca3b
...@@ -298,7 +298,8 @@ struct nft_set_ops { ...@@ -298,7 +298,8 @@ struct nft_set_ops {
bool (*deactivate_one)(const struct net *net, bool (*deactivate_one)(const struct net *net,
const struct nft_set *set, const struct nft_set *set,
void *priv); void *priv);
void (*remove)(const struct nft_set *set, void (*remove)(const struct net *net,
const struct nft_set *set,
const struct nft_set_elem *elem); const struct nft_set_elem *elem);
void (*walk)(const struct nft_ctx *ctx, void (*walk)(const struct nft_ctx *ctx,
struct nft_set *set, struct nft_set *set,
......
...@@ -3752,7 +3752,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set, ...@@ -3752,7 +3752,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
return 0; return 0;
err6: err6:
set->ops->remove(set, &elem); set->ops->remove(ctx->net, set, &elem);
err5: err5:
kfree(trans); kfree(trans);
err4: err4:
...@@ -4804,7 +4804,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) ...@@ -4804,7 +4804,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
nf_tables_setelem_notify(&trans->ctx, te->set, nf_tables_setelem_notify(&trans->ctx, te->set,
&te->elem, &te->elem,
NFT_MSG_DELSETELEM, 0); NFT_MSG_DELSETELEM, 0);
te->set->ops->remove(te->set, &te->elem); te->set->ops->remove(net, te->set, &te->elem);
atomic_dec(&te->set->nelems); atomic_dec(&te->set->nelems);
te->set->ndeact--; te->set->ndeact--;
break; break;
...@@ -4925,7 +4925,7 @@ static int nf_tables_abort(struct net *net, struct sk_buff *skb) ...@@ -4925,7 +4925,7 @@ static int nf_tables_abort(struct net *net, struct sk_buff *skb)
case NFT_MSG_NEWSETELEM: case NFT_MSG_NEWSETELEM:
te = (struct nft_trans_elem *)trans->data; te = (struct nft_trans_elem *)trans->data;
te->set->ops->remove(te->set, &te->elem); te->set->ops->remove(net, te->set, &te->elem);
atomic_dec(&te->set->nelems); atomic_dec(&te->set->nelems);
break; break;
case NFT_MSG_DELSETELEM: case NFT_MSG_DELSETELEM:
......
...@@ -203,7 +203,8 @@ static void *nft_hash_deactivate(const struct net *net, ...@@ -203,7 +203,8 @@ static void *nft_hash_deactivate(const struct net *net,
return he; return he;
} }
static void nft_hash_remove(const struct nft_set *set, static void nft_hash_remove(const struct net *net,
const struct nft_set *set,
const struct nft_set_elem *elem) const struct nft_set_elem *elem)
{ {
struct nft_hash *priv = nft_set_priv(set); struct nft_hash *priv = nft_set_priv(set);
......
...@@ -151,7 +151,8 @@ static int nft_rbtree_insert(const struct net *net, const struct nft_set *set, ...@@ -151,7 +151,8 @@ static int nft_rbtree_insert(const struct net *net, const struct nft_set *set,
return err; return err;
} }
static void nft_rbtree_remove(const struct nft_set *set, static void nft_rbtree_remove(const struct net *net,
const struct nft_set *set,
const struct nft_set_elem *elem) const struct nft_set_elem *elem)
{ {
struct nft_rbtree *priv = nft_set_priv(set); struct nft_rbtree *priv = nft_set_priv(set);
......
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