hulk inclusion category: feature bugzilla: https://atomgit.com/src-openeuler/kernel/issues/13525 -------------------------------- This reverts commit f2fcff436024b99d78578964d09a3b50b459bdde. Rolling back this patch again to resolve previous conflicts Signed-off-by: Dong Chenchen <dongchenchen2@huawei.com> --- net/netfilter/nft_objref.c | 41 -------------------------------------- 1 file changed, 41 deletions(-) diff --git a/net/netfilter/nft_objref.c b/net/netfilter/nft_objref.c index 2e024f4dd603..509011b1ef59 100644 --- a/net/netfilter/nft_objref.c +++ b/net/netfilter/nft_objref.c @@ -22,36 +22,6 @@ void nft_objref_eval(const struct nft_expr *expr, obj->ops->eval(obj, regs, pkt); } -static int nft_objref_validate_obj_type(const struct nft_ctx *ctx, u32 type) -{ - unsigned int hooks; - - switch (type) { - case NFT_OBJECT_SYNPROXY: - if (ctx->family != NFPROTO_IPV4 && - ctx->family != NFPROTO_IPV6 && - ctx->family != NFPROTO_INET) - return -EOPNOTSUPP; - - hooks = (1 << NF_INET_LOCAL_IN) | (1 << NF_INET_FORWARD); - - return nft_chain_validate_hooks(ctx->chain, hooks); - default: - break; - } - - return 0; -} - -static int nft_objref_validate(const struct nft_ctx *ctx, - const struct nft_expr *expr, - const struct nft_data **data) -{ - struct nft_object *obj = nft_objref_priv(expr); - - return nft_objref_validate_obj_type(ctx, obj->ops->type->type); -} - static int nft_objref_init(const struct nft_ctx *ctx, const struct nft_expr *expr, const struct nlattr * const tb[]) @@ -123,7 +93,6 @@ static const struct nft_expr_ops nft_objref_ops = { .activate = nft_objref_activate, .deactivate = nft_objref_deactivate, .dump = nft_objref_dump, - .validate = nft_objref_validate, .reduce = NFT_REDUCE_READONLY, }; @@ -229,15 +198,6 @@ static void nft_objref_map_destroy(const struct nft_ctx *ctx, nf_tables_destroy_set(ctx, priv->set); } -static int nft_objref_map_validate(const struct nft_ctx *ctx, - const struct nft_expr *expr, - const struct nft_data **data) -{ - const struct nft_objref_map *priv = nft_expr_priv(expr); - - return nft_objref_validate_obj_type(ctx, priv->set->objtype); -} - static const struct nft_expr_ops nft_objref_map_ops = { .type = &nft_objref_type, .size = NFT_EXPR_SIZE(sizeof(struct nft_objref_map)), @@ -247,7 +207,6 @@ static const struct nft_expr_ops nft_objref_map_ops = { .deactivate = nft_objref_map_deactivate, .destroy = nft_objref_map_destroy, .dump = nft_objref_map_dump, - .validate = nft_objref_map_validate, .reduce = NFT_REDUCE_READONLY, }; -- 2.25.1