Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nf_tables: drop unused 3rd argument from validate callback ops

Since commit a654de8fdc18 ("netfilter: nf_tables: fix chain dependency validation")
the validate() callback no longer needs the return pointer argument.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Florian Westphal and committed by
Pablo Neira Ayuso
eaf9b2c8 09c0d0ae

+30 -60
+1 -2
include/net/netfilter/nf_tables.h
··· 961 961 const struct nft_expr *expr, 962 962 bool reset); 963 963 int (*validate)(const struct nft_ctx *ctx, 964 - const struct nft_expr *expr, 965 - const struct nft_data **data); 964 + const struct nft_expr *expr); 966 965 bool (*reduce)(struct nft_regs_track *track, 967 966 const struct nft_expr *expr); 968 967 bool (*gc)(struct net *net,
+1 -3
include/net/netfilter/nft_fib.h
··· 21 21 int nft_fib_dump(struct sk_buff *skb, const struct nft_expr *expr, bool reset); 22 22 int nft_fib_init(const struct nft_ctx *ctx, const struct nft_expr *expr, 23 23 const struct nlattr * const tb[]); 24 - int nft_fib_validate(const struct nft_ctx *ctx, const struct nft_expr *expr, 25 - const struct nft_data **data); 26 - 24 + int nft_fib_validate(const struct nft_ctx *ctx, const struct nft_expr *expr); 27 25 28 26 void nft_fib4_eval_type(const struct nft_expr *expr, struct nft_regs *regs, 29 27 const struct nft_pktinfo *pkt);
+1 -2
include/net/netfilter/nft_meta.h
··· 41 41 const struct nft_expr *expr); 42 42 43 43 int nft_meta_set_validate(const struct nft_ctx *ctx, 44 - const struct nft_expr *expr, 45 - const struct nft_data **data); 44 + const struct nft_expr *expr); 46 45 47 46 bool nft_meta_get_reduce(struct nft_regs_track *track, 48 47 const struct nft_expr *expr);
+1 -2
include/net/netfilter/nft_reject.h
··· 15 15 extern const struct nla_policy nft_reject_policy[]; 16 16 17 17 int nft_reject_validate(const struct nft_ctx *ctx, 18 - const struct nft_expr *expr, 19 - const struct nft_data **data); 18 + const struct nft_expr *expr); 20 19 21 20 int nft_reject_init(const struct nft_ctx *ctx, 22 21 const struct nft_expr *expr,
+2 -3
net/bridge/netfilter/nft_meta_bridge.c
··· 168 168 } 169 169 170 170 static int nft_meta_bridge_set_validate(const struct nft_ctx *ctx, 171 - const struct nft_expr *expr, 172 - const struct nft_data **data) 171 + const struct nft_expr *expr) 173 172 { 174 173 struct nft_meta *priv = nft_expr_priv(expr); 175 174 unsigned int hooks; ··· 178 179 hooks = 1 << NF_BR_PRE_ROUTING; 179 180 break; 180 181 default: 181 - return nft_meta_set_validate(ctx, expr, data); 182 + return nft_meta_set_validate(ctx, expr); 182 183 } 183 184 184 185 return nft_chain_validate_hooks(ctx->chain, hooks);
+1 -2
net/bridge/netfilter/nft_reject_bridge.c
··· 170 170 } 171 171 172 172 static int nft_reject_bridge_validate(const struct nft_ctx *ctx, 173 - const struct nft_expr *expr, 174 - const struct nft_data **data) 173 + const struct nft_expr *expr) 175 174 { 176 175 return nft_chain_validate_hooks(ctx->chain, (1 << NF_BR_PRE_ROUTING) | 177 176 (1 << NF_BR_LOCAL_IN));
+1 -2
net/netfilter/nf_tables_api.c
··· 3886 3886 int nft_chain_validate(const struct nft_ctx *ctx, const struct nft_chain *chain) 3887 3887 { 3888 3888 struct nft_expr *expr, *last; 3889 - const struct nft_data *data; 3890 3889 struct nft_rule *rule; 3891 3890 int err; 3892 3891 ··· 3906 3907 /* This may call nft_chain_validate() recursively, 3907 3908 * callers that do so must increment ctx->level. 3908 3909 */ 3909 - err = expr->ops->validate(ctx, expr, &data); 3910 + err = expr->ops->validate(ctx, expr); 3910 3911 if (err < 0) 3911 3912 return err; 3912 3913 }
+2 -4
net/netfilter/nft_compat.c
··· 350 350 } 351 351 352 352 static int nft_target_validate(const struct nft_ctx *ctx, 353 - const struct nft_expr *expr, 354 - const struct nft_data **data) 353 + const struct nft_expr *expr) 355 354 { 356 355 struct xt_target *target = expr->ops->data; 357 356 unsigned int hook_mask = 0; ··· 610 611 } 611 612 612 613 static int nft_match_validate(const struct nft_ctx *ctx, 613 - const struct nft_expr *expr, 614 - const struct nft_data **data) 614 + const struct nft_expr *expr) 615 615 { 616 616 struct xt_match *match = expr->ops->data; 617 617 unsigned int hook_mask = 0;
+1 -2
net/netfilter/nft_fib.c
··· 26 26 }; 27 27 EXPORT_SYMBOL(nft_fib_policy); 28 28 29 - int nft_fib_validate(const struct nft_ctx *ctx, const struct nft_expr *expr, 30 - const struct nft_data **data) 29 + int nft_fib_validate(const struct nft_ctx *ctx, const struct nft_expr *expr) 31 30 { 32 31 const struct nft_fib *priv = nft_expr_priv(expr); 33 32 unsigned int hooks;
+1 -2
net/netfilter/nft_flow_offload.c
··· 380 380 } 381 381 382 382 static int nft_flow_offload_validate(const struct nft_ctx *ctx, 383 - const struct nft_expr *expr, 384 - const struct nft_data **data) 383 + const struct nft_expr *expr) 385 384 { 386 385 unsigned int hook_mask = (1 << NF_INET_FORWARD); 387 386
+1 -2
net/netfilter/nft_fwd_netdev.c
··· 204 204 } 205 205 206 206 static int nft_fwd_validate(const struct nft_ctx *ctx, 207 - const struct nft_expr *expr, 208 - const struct nft_data **data) 207 + const struct nft_expr *expr) 209 208 { 210 209 return nft_chain_validate_hooks(ctx->chain, (1 << NF_NETDEV_INGRESS) | 211 210 (1 << NF_NETDEV_EGRESS));
+1 -2
net/netfilter/nft_immediate.c
··· 244 244 } 245 245 246 246 static int nft_immediate_validate(const struct nft_ctx *ctx, 247 - const struct nft_expr *expr, 248 - const struct nft_data **d) 247 + const struct nft_expr *expr) 249 248 { 250 249 const struct nft_immediate_expr *priv = nft_expr_priv(expr); 251 250 struct nft_ctx *pctx = (struct nft_ctx *)ctx;
+1 -2
net/netfilter/nft_lookup.c
··· 206 206 } 207 207 208 208 static int nft_lookup_validate(const struct nft_ctx *ctx, 209 - const struct nft_expr *expr, 210 - const struct nft_data **d) 209 + const struct nft_expr *expr) 211 210 { 212 211 const struct nft_lookup *priv = nft_expr_priv(expr); 213 212 struct nft_set_iter iter;
+1 -2
net/netfilter/nft_masq.c
··· 27 27 }; 28 28 29 29 static int nft_masq_validate(const struct nft_ctx *ctx, 30 - const struct nft_expr *expr, 31 - const struct nft_data **data) 30 + const struct nft_expr *expr) 32 31 { 33 32 int err; 34 33
+2 -4
net/netfilter/nft_meta.c
··· 581 581 } 582 582 583 583 static int nft_meta_get_validate(const struct nft_ctx *ctx, 584 - const struct nft_expr *expr, 585 - const struct nft_data **data) 584 + const struct nft_expr *expr) 586 585 { 587 586 const struct nft_meta *priv = nft_expr_priv(expr); 588 587 ··· 599 600 } 600 601 601 602 int nft_meta_set_validate(const struct nft_ctx *ctx, 602 - const struct nft_expr *expr, 603 - const struct nft_data **data) 603 + const struct nft_expr *expr) 604 604 { 605 605 struct nft_meta *priv = nft_expr_priv(expr); 606 606 unsigned int hooks;
+1 -2
net/netfilter/nft_nat.c
··· 137 137 }; 138 138 139 139 static int nft_nat_validate(const struct nft_ctx *ctx, 140 - const struct nft_expr *expr, 141 - const struct nft_data **data) 140 + const struct nft_expr *expr) 142 141 { 143 142 struct nft_nat *priv = nft_expr_priv(expr); 144 143 int err;
+1 -2
net/netfilter/nft_osf.c
··· 108 108 } 109 109 110 110 static int nft_osf_validate(const struct nft_ctx *ctx, 111 - const struct nft_expr *expr, 112 - const struct nft_data **data) 111 + const struct nft_expr *expr) 113 112 { 114 113 unsigned int hooks; 115 114
+1 -2
net/netfilter/nft_queue.c
··· 69 69 } 70 70 71 71 static int nft_queue_validate(const struct nft_ctx *ctx, 72 - const struct nft_expr *expr, 73 - const struct nft_data **data) 72 + const struct nft_expr *expr) 74 73 { 75 74 static const unsigned int supported_hooks = ((1 << NF_INET_PRE_ROUTING) | 76 75 (1 << NF_INET_LOCAL_IN) |
+1 -2
net/netfilter/nft_redir.c
··· 27 27 }; 28 28 29 29 static int nft_redir_validate(const struct nft_ctx *ctx, 30 - const struct nft_expr *expr, 31 - const struct nft_data **data) 30 + const struct nft_expr *expr) 32 31 { 33 32 int err; 34 33
+1 -2
net/netfilter/nft_reject.c
··· 24 24 EXPORT_SYMBOL_GPL(nft_reject_policy); 25 25 26 26 int nft_reject_validate(const struct nft_ctx *ctx, 27 - const struct nft_expr *expr, 28 - const struct nft_data **data) 27 + const struct nft_expr *expr) 29 28 { 30 29 return nft_chain_validate_hooks(ctx->chain, 31 30 (1 << NF_INET_LOCAL_IN) |
+1 -2
net/netfilter/nft_reject_inet.c
··· 61 61 } 62 62 63 63 static int nft_reject_inet_validate(const struct nft_ctx *ctx, 64 - const struct nft_expr *expr, 65 - const struct nft_data **data) 64 + const struct nft_expr *expr) 66 65 { 67 66 return nft_chain_validate_hooks(ctx->chain, 68 67 (1 << NF_INET_LOCAL_IN) |
+1 -2
net/netfilter/nft_reject_netdev.c
··· 145 145 } 146 146 147 147 static int nft_reject_netdev_validate(const struct nft_ctx *ctx, 148 - const struct nft_expr *expr, 149 - const struct nft_data **data) 148 + const struct nft_expr *expr) 150 149 { 151 150 return nft_chain_validate_hooks(ctx->chain, (1 << NF_NETDEV_INGRESS)); 152 151 }
+1 -2
net/netfilter/nft_rt.c
··· 160 160 return -1; 161 161 } 162 162 163 - static int nft_rt_validate(const struct nft_ctx *ctx, const struct nft_expr *expr, 164 - const struct nft_data **data) 163 + static int nft_rt_validate(const struct nft_ctx *ctx, const struct nft_expr *expr) 165 164 { 166 165 const struct nft_rt *priv = nft_expr_priv(expr); 167 166 unsigned int hooks;
+1 -2
net/netfilter/nft_socket.c
··· 239 239 } 240 240 241 241 static int nft_socket_validate(const struct nft_ctx *ctx, 242 - const struct nft_expr *expr, 243 - const struct nft_data **data) 242 + const struct nft_expr *expr) 244 243 { 245 244 if (ctx->family != NFPROTO_IPV4 && 246 245 ctx->family != NFPROTO_IPV6 &&
+1 -2
net/netfilter/nft_synproxy.c
··· 248 248 } 249 249 250 250 static int nft_synproxy_validate(const struct nft_ctx *ctx, 251 - const struct nft_expr *expr, 252 - const struct nft_data **data) 251 + const struct nft_expr *expr) 253 252 { 254 253 if (ctx->family != NFPROTO_IPV4 && 255 254 ctx->family != NFPROTO_IPV6 &&
+1 -2
net/netfilter/nft_tproxy.c
··· 313 313 } 314 314 315 315 static int nft_tproxy_validate(const struct nft_ctx *ctx, 316 - const struct nft_expr *expr, 317 - const struct nft_data **data) 316 + const struct nft_expr *expr) 318 317 { 319 318 if (ctx->family != NFPROTO_IPV4 && 320 319 ctx->family != NFPROTO_IPV6 &&
+1 -2
net/netfilter/nft_xfrm.c
··· 229 229 return 0; 230 230 } 231 231 232 - static int nft_xfrm_validate(const struct nft_ctx *ctx, const struct nft_expr *expr, 233 - const struct nft_data **data) 232 + static int nft_xfrm_validate(const struct nft_ctx *ctx, const struct nft_expr *expr) 234 233 { 235 234 const struct nft_xfrm *priv = nft_expr_priv(expr); 236 235 unsigned int hooks;