|
@@ -26,11 +26,27 @@ const struct nla_policy nft_reject_policy[NFTA_REJECT_MAX + 1] = {
|
|
|
};
|
|
|
EXPORT_SYMBOL_GPL(nft_reject_policy);
|
|
|
|
|
|
+int nft_reject_validate(const struct nft_ctx *ctx,
|
|
|
+ const struct nft_expr *expr,
|
|
|
+ const struct nft_data **data)
|
|
|
+{
|
|
|
+ return nft_chain_validate_hooks(ctx->chain,
|
|
|
+ (1 << NF_INET_LOCAL_IN) |
|
|
|
+ (1 << NF_INET_FORWARD) |
|
|
|
+ (1 << NF_INET_LOCAL_OUT));
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(nft_reject_validate);
|
|
|
+
|
|
|
int nft_reject_init(const struct nft_ctx *ctx,
|
|
|
const struct nft_expr *expr,
|
|
|
const struct nlattr * const tb[])
|
|
|
{
|
|
|
struct nft_reject *priv = nft_expr_priv(expr);
|
|
|
+ int err;
|
|
|
+
|
|
|
+ err = nft_reject_validate(ctx, expr, NULL);
|
|
|
+ if (err < 0)
|
|
|
+ return err;
|
|
|
|
|
|
if (tb[NFTA_REJECT_TYPE] == NULL)
|
|
|
return -EINVAL;
|