mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
netfilter: nf_tables: add conntrack dependencies for nat/masq/redir expressions
so that conntrack core will add the needed hooks in this namespace. Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
This commit is contained in:
parent
a357b3f80b
commit
20afd42397
7 changed files with 40 additions and 3 deletions
|
|
@ -35,12 +35,19 @@ static void nft_masq_ipv4_eval(const struct nft_expr *expr,
|
|||
&range, nft_out(pkt));
|
||||
}
|
||||
|
||||
static void
|
||||
nft_masq_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_masq_ipv4_type;
|
||||
static const struct nft_expr_ops nft_masq_ipv4_ops = {
|
||||
.type = &nft_masq_ipv4_type,
|
||||
.size = NFT_EXPR_SIZE(sizeof(struct nft_masq)),
|
||||
.eval = nft_masq_ipv4_eval,
|
||||
.init = nft_masq_init,
|
||||
.destroy = nft_masq_ipv4_destroy,
|
||||
.dump = nft_masq_dump,
|
||||
.validate = nft_masq_validate,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
||||
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 const struct nft_expr_ops nft_redir_ipv4_ops = {
|
||||
.type = &nft_redir_ipv4_type,
|
||||
.size = NFT_EXPR_SIZE(sizeof(struct nft_redir)),
|
||||
.eval = nft_redir_ipv4_eval,
|
||||
.init = nft_redir_init,
|
||||
.destroy = nft_redir_ipv4_destroy,
|
||||
.dump = nft_redir_dump,
|
||||
.validate = nft_redir_validate,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue