netfilter: nf_tables: pass netns to set->ops->remove()
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 18 Jan 2017 17:30:07 +0000 (18:30 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 8 Feb 2017 13:16:18 +0000 (14:16 +0100)
This new parameter is required by the new bitmap set type that comes in a
follow up patch.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c
net/netfilter/nft_set_hash.c
net/netfilter/nft_set_rbtree.c

index 7dfdb517f0be826018cf649bb2e410e44d8f9c36..a721bcb1210c67a6c660994c444bbd1b7c044ed2 100644 (file)
@@ -298,7 +298,8 @@ struct nft_set_ops {
        bool                            (*deactivate_one)(const struct net *net,
                                                          const struct nft_set *set,
                                                          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);
        void                            (*walk)(const struct nft_ctx *ctx,
                                                struct nft_set *set,
index 57eeae63f597ed192213ddedb47025434750c1ad..3643ce345b59838ce8801a13979e8bdc231a09dc 100644 (file)
@@ -3752,7 +3752,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
        return 0;
 
 err6:
-       set->ops->remove(set, &elem);
+       set->ops->remove(ctx->net, set, &elem);
 err5:
        kfree(trans);
 err4:
@@ -4804,7 +4804,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
                        nf_tables_setelem_notify(&trans->ctx, te->set,
                                                 &te->elem,
                                                 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);
                        te->set->ndeact--;
                        break;
@@ -4925,7 +4925,7 @@ static int nf_tables_abort(struct net *net, struct sk_buff *skb)
                case NFT_MSG_NEWSETELEM:
                        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);
                        break;
                case NFT_MSG_DELSETELEM:
index e36069fb76aebd4140098f38a3758135e78b8d43..bb157bd47fe8966e4a80b31e12683deecdc4b96f 100644 (file)
@@ -203,7 +203,8 @@ static void *nft_hash_deactivate(const struct net *net,
        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)
 {
        struct nft_hash *priv = nft_set_priv(set);
index f06f55ee516de44d3b0367cc52afb32173a2d0e8..9fbd70da16332cca75e142b43be4691db5204bf7 100644 (file)
@@ -151,7 +151,8 @@ static int nft_rbtree_insert(const struct net *net, const struct nft_set *set,
        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)
 {
        struct nft_rbtree *priv = nft_set_priv(set);