summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2017-01-23 18:51:41 -0500
committerPablo Neira Ayuso <pablo@netfilter.org>2017-01-24 15:46:58 -0500
commitde70185de0333783154863278ac87bfbbc54e384 (patch)
tree6626cd05fd65bbdcd1a73e35c2cebd5c33f1ef37 /net
parent35d0ac9070ef619e3bf44324375878a1c540387b (diff)
netfilter: nf_tables: deconstify walk callback function
The flush operation needs to modify set and element objects, so let's deconstify this. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nf_tables_api.c24
-rw-r--r--net/netfilter/nft_set_hash.c2
-rw-r--r--net/netfilter/nft_set_rbtree.c2
3 files changed, 14 insertions, 14 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 831a9a16f563..5bd0068320fb 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -3087,9 +3087,9 @@ static int nf_tables_delset(struct net *net, struct sock *nlsk,
3087} 3087}
3088 3088
3089static int nf_tables_bind_check_setelem(const struct nft_ctx *ctx, 3089static int nf_tables_bind_check_setelem(const struct nft_ctx *ctx,
3090 const struct nft_set *set, 3090 struct nft_set *set,
3091 const struct nft_set_iter *iter, 3091 const struct nft_set_iter *iter,
3092 const struct nft_set_elem *elem) 3092 struct nft_set_elem *elem)
3093{ 3093{
3094 const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv); 3094 const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv);
3095 enum nft_registers dreg; 3095 enum nft_registers dreg;
@@ -3308,9 +3308,9 @@ struct nft_set_dump_args {
3308}; 3308};
3309 3309
3310static int nf_tables_dump_setelem(const struct nft_ctx *ctx, 3310static int nf_tables_dump_setelem(const struct nft_ctx *ctx,
3311 const struct nft_set *set, 3311 struct nft_set *set,
3312 const struct nft_set_iter *iter, 3312 const struct nft_set_iter *iter,
3313 const struct nft_set_elem *elem) 3313 struct nft_set_elem *elem)
3314{ 3314{
3315 struct nft_set_dump_args *args; 3315 struct nft_set_dump_args *args;
3316 3316
@@ -3322,7 +3322,7 @@ static int nf_tables_dump_set(struct sk_buff *skb, struct netlink_callback *cb)
3322{ 3322{
3323 struct net *net = sock_net(skb->sk); 3323 struct net *net = sock_net(skb->sk);
3324 u8 genmask = nft_genmask_cur(net); 3324 u8 genmask = nft_genmask_cur(net);
3325 const struct nft_set *set; 3325 struct nft_set *set;
3326 struct nft_set_dump_args args; 3326 struct nft_set_dump_args args;
3327 struct nft_ctx ctx; 3327 struct nft_ctx ctx;
3328 struct nlattr *nla[NFTA_SET_ELEM_LIST_MAX + 1]; 3328 struct nlattr *nla[NFTA_SET_ELEM_LIST_MAX + 1];
@@ -3890,9 +3890,9 @@ err1:
3890} 3890}
3891 3891
3892static int nft_flush_set(const struct nft_ctx *ctx, 3892static int nft_flush_set(const struct nft_ctx *ctx,
3893 const struct nft_set *set, 3893 struct nft_set *set,
3894 const struct nft_set_iter *iter, 3894 const struct nft_set_iter *iter,
3895 const struct nft_set_elem *elem) 3895 struct nft_set_elem *elem)
3896{ 3896{
3897 struct nft_trans *trans; 3897 struct nft_trans *trans;
3898 int err; 3898 int err;
@@ -3907,8 +3907,8 @@ static int nft_flush_set(const struct nft_ctx *ctx,
3907 goto err1; 3907 goto err1;
3908 } 3908 }
3909 3909
3910 nft_trans_elem_set(trans) = (struct nft_set *)set; 3910 nft_trans_elem_set(trans) = set;
3911 nft_trans_elem(trans) = *((struct nft_set_elem *)elem); 3911 nft_trans_elem(trans) = *elem;
3912 list_add_tail(&trans->list, &ctx->net->nft.commit_list); 3912 list_add_tail(&trans->list, &ctx->net->nft.commit_list);
3913 3913
3914 return 0; 3914 return 0;
@@ -5019,9 +5019,9 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx,
5019 const struct nft_chain *chain); 5019 const struct nft_chain *chain);
5020 5020
5021static int nf_tables_loop_check_setelem(const struct nft_ctx *ctx, 5021static int nf_tables_loop_check_setelem(const struct nft_ctx *ctx,
5022 const struct nft_set *set, 5022 struct nft_set *set,
5023 const struct nft_set_iter *iter, 5023 const struct nft_set_iter *iter,
5024 const struct nft_set_elem *elem) 5024 struct nft_set_elem *elem)
5025{ 5025{
5026 const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv); 5026 const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv);
5027 const struct nft_data *data; 5027 const struct nft_data *data;
@@ -5045,7 +5045,7 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx,
5045{ 5045{
5046 const struct nft_rule *rule; 5046 const struct nft_rule *rule;
5047 const struct nft_expr *expr, *last; 5047 const struct nft_expr *expr, *last;
5048 const struct nft_set *set; 5048 struct nft_set *set;
5049 struct nft_set_binding *binding; 5049 struct nft_set_binding *binding;
5050 struct nft_set_iter iter; 5050 struct nft_set_iter iter;
5051 5051
diff --git a/net/netfilter/nft_set_hash.c b/net/netfilter/nft_set_hash.c
index 1e20e2bbb6d9..e36069fb76ae 100644
--- a/net/netfilter/nft_set_hash.c
+++ b/net/netfilter/nft_set_hash.c
@@ -212,7 +212,7 @@ static void nft_hash_remove(const struct nft_set *set,
212 rhashtable_remove_fast(&priv->ht, &he->node, nft_hash_params); 212 rhashtable_remove_fast(&priv->ht, &he->node, nft_hash_params);
213} 213}
214 214
215static void nft_hash_walk(const struct nft_ctx *ctx, const struct nft_set *set, 215static void nft_hash_walk(const struct nft_ctx *ctx, struct nft_set *set,
216 struct nft_set_iter *iter) 216 struct nft_set_iter *iter)
217{ 217{
218 struct nft_hash *priv = nft_set_priv(set); 218 struct nft_hash *priv = nft_set_priv(set);
diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
index 08376e50f6cd..f06f55ee516d 100644
--- a/net/netfilter/nft_set_rbtree.c
+++ b/net/netfilter/nft_set_rbtree.c
@@ -221,7 +221,7 @@ static void *nft_rbtree_deactivate(const struct net *net,
221} 221}
222 222
223static void nft_rbtree_walk(const struct nft_ctx *ctx, 223static void nft_rbtree_walk(const struct nft_ctx *ctx,
224 const struct nft_set *set, 224 struct nft_set *set,
225 struct nft_set_iter *iter) 225 struct nft_set_iter *iter)
226{ 226{
227 const struct nft_rbtree *priv = nft_set_priv(set); 227 const struct nft_rbtree *priv = nft_set_priv(set);