Commit 23715275 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Pablo Neira Ayuso

netfilter: ip6t_MASQUERADE: add dependency on conntrack module

After commit 4d3a57f2 ("netfilter: conntrack: do not enable connection
tracking unless needed") conntrack is disabled by default unless some
module explicitly declares dependency in particular network namespace.

Fixes: a357b3f8 ("netfilter: nat: add dependencies on conntrack module")
Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent f5b5702a
...@@ -33,13 +33,19 @@ static int masquerade_tg6_checkentry(const struct xt_tgchk_param *par) ...@@ -33,13 +33,19 @@ static int masquerade_tg6_checkentry(const struct xt_tgchk_param *par)
if (range->flags & NF_NAT_RANGE_MAP_IPS) if (range->flags & NF_NAT_RANGE_MAP_IPS)
return -EINVAL; return -EINVAL;
return 0; return nf_ct_netns_get(par->net, par->family);
}
static void masquerade_tg6_destroy(const struct xt_tgdtor_param *par)
{
nf_ct_netns_put(par->net, par->family);
} }
static struct xt_target masquerade_tg6_reg __read_mostly = { static struct xt_target masquerade_tg6_reg __read_mostly = {
.name = "MASQUERADE", .name = "MASQUERADE",
.family = NFPROTO_IPV6, .family = NFPROTO_IPV6,
.checkentry = masquerade_tg6_checkentry, .checkentry = masquerade_tg6_checkentry,
.destroy = masquerade_tg6_destroy,
.target = masquerade_tg6, .target = masquerade_tg6,
.targetsize = sizeof(struct nf_nat_range), .targetsize = sizeof(struct nf_nat_range),
.table = "nat", .table = "nat",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment