|
@@ -38,12 +38,19 @@ static void nft_redir_ipv4_eval(const struct nft_expr *expr,
|
|
regs->verdict.code = nf_nat_redirect_ipv4(pkt->skb, &mr, nft_hook(pkt));
|
|
regs->verdict.code = nf_nat_redirect_ipv4(pkt->skb, &mr, nft_hook(pkt));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void
|
|
|
|
+nft_redir_ipv4_destroy(const struct nft_ctx *ctx, const struct nft_expr *expr)
|
|
|
|
+{
|
|
|
|
+ nf_ct_netns_put(ctx->net, NFPROTO_IPV4);
|
|
|
|
+}
|
|
|
|
+
|
|
static struct nft_expr_type nft_redir_ipv4_type;
|
|
static struct nft_expr_type nft_redir_ipv4_type;
|
|
static const struct nft_expr_ops nft_redir_ipv4_ops = {
|
|
static const struct nft_expr_ops nft_redir_ipv4_ops = {
|
|
.type = &nft_redir_ipv4_type,
|
|
.type = &nft_redir_ipv4_type,
|
|
.size = NFT_EXPR_SIZE(sizeof(struct nft_redir)),
|
|
.size = NFT_EXPR_SIZE(sizeof(struct nft_redir)),
|
|
.eval = nft_redir_ipv4_eval,
|
|
.eval = nft_redir_ipv4_eval,
|
|
.init = nft_redir_init,
|
|
.init = nft_redir_init,
|
|
|
|
+ .destroy = nft_redir_ipv4_destroy,
|
|
.dump = nft_redir_dump,
|
|
.dump = nft_redir_dump,
|
|
.validate = nft_redir_validate,
|
|
.validate = nft_redir_validate,
|
|
};
|
|
};
|