diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-08 05:35:11 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-10-08 05:35:11 -0400 |
commit | 9174c1538fffbb5dddab99563eac6b3d8b212277 (patch) | |
tree | 56cf701567ee36d8d3db0e466e12ba8ca8af9ef5 /net/ipv4 | |
parent | 0c4c9288ada0e6642d511ef872f10a4781a896ff (diff) |
netfilter: netns nf_conntrack: fixup DNAT in netns
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/nf_nat_rule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/netfilter/nf_nat_rule.c b/net/ipv4/netfilter/nf_nat_rule.c index 0a02a8caf3b..f929352ec0e 100644 --- a/net/ipv4/netfilter/nf_nat_rule.c +++ b/net/ipv4/netfilter/nf_nat_rule.c | |||
@@ -91,13 +91,13 @@ static unsigned int ipt_snat_target(struct sk_buff *skb, | |||
91 | } | 91 | } |
92 | 92 | ||
93 | /* Before 2.6.11 we did implicit source NAT if required. Warn about change. */ | 93 | /* Before 2.6.11 we did implicit source NAT if required. Warn about change. */ |
94 | static void warn_if_extra_mangle(__be32 dstip, __be32 srcip) | 94 | static void warn_if_extra_mangle(struct net *net, __be32 dstip, __be32 srcip) |
95 | { | 95 | { |
96 | static int warned = 0; | 96 | static int warned = 0; |
97 | struct flowi fl = { .nl_u = { .ip4_u = { .daddr = dstip } } }; | 97 | struct flowi fl = { .nl_u = { .ip4_u = { .daddr = dstip } } }; |
98 | struct rtable *rt; | 98 | struct rtable *rt; |
99 | 99 | ||
100 | if (ip_route_output_key(&init_net, &rt, &fl) != 0) | 100 | if (ip_route_output_key(net, &rt, &fl) != 0) |
101 | return; | 101 | return; |
102 | 102 | ||
103 | if (rt->rt_src != srcip && !warned) { | 103 | if (rt->rt_src != srcip && !warned) { |
@@ -130,7 +130,7 @@ static unsigned int ipt_dnat_target(struct sk_buff *skb, | |||
130 | 130 | ||
131 | if (hooknum == NF_INET_LOCAL_OUT && | 131 | if (hooknum == NF_INET_LOCAL_OUT && |
132 | mr->range[0].flags & IP_NAT_RANGE_MAP_IPS) | 132 | mr->range[0].flags & IP_NAT_RANGE_MAP_IPS) |
133 | warn_if_extra_mangle(ip_hdr(skb)->daddr, | 133 | warn_if_extra_mangle(dev_net(out), ip_hdr(skb)->daddr, |
134 | mr->range[0].min_ip); | 134 | mr->range[0].min_ip); |
135 | 135 | ||
136 | return nf_nat_setup_info(ct, &mr->range[0], IP_NAT_MANIP_DST); | 136 | return nf_nat_setup_info(ct, &mr->range[0], IP_NAT_MANIP_DST); |