aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_nat.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-09-04net: Replace NF_CT_ASSERT() with WARN_ON().Varsha Rao1-10/+10
This patch removes NF_CT_ASSERT() and instead uses WARN_ON(). Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
2016-12-04netfilter: nat: add dependencies on conntrack moduleFlorian Westphal1-1/+17
MASQUERADE, S/DNAT and REDIRECT already call functions that depend on the conntrack module. However, since the conntrack hooks are now registered in a lazy fashion (i.e., only when needed) a symbol reference is not enough. Thus, when something is added to a nat table, make sure that it will see packets by calling nf_ct_netns_get() which will register the conntrack hooks in the current netns. An alternative would be to add these dependencies to the NAT table. However, that has problems when using non-modular builds -- we might register e.g. ipv6 conntrack before its initcall has run, leading to NULL deref crashes since its per-netns storage has not yet been allocated. Adding the dependency in the modules instead has the advantage that nat table also does not register its hooks until rules are added. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2012-10-15netfilter: xt_nat: fix incorrect hooks for SNAT and DNAT targetsElison Niven1-4/+4
In (c7232c9 netfilter: add protocol independent NAT core), the hooks were accidentally modified: SNAT hooks are POST_ROUTING and LOCAL_IN (before it was LOCAL_OUT). DNAT hooks are PRE_ROUTING and LOCAL_OUT (before it was LOCAL_IN). Signed-off-by: Elison Niven <elison.niven@cyberoam.com> Signed-off-by: Sanket Shah <sanket.shah@cyberoam.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2012-08-30netfilter: ipv6: add IPv6 NAT supportPatrick McHardy1-0/+3
Signed-off-by: Patrick McHardy <kaber@trash.net>
2012-08-30netfilter: add protocol independent NAT corePatrick McHardy1-0/+167
Convert the IPv4 NAT implementation to a protocol independent core and address family specific modules. Signed-off-by: Patrick McHardy <kaber@trash.net>