summaryrefslogtreecommitdiff
path: root/net/ipv4/netfilter/iptable_nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/netfilter/iptable_nat.c')
-rw-r--r--net/ipv4/netfilter/iptable_nat.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv4/netfilter/iptable_nat.c b/net/ipv4/netfilter/iptable_nat.c
index a89c1b9f94c2..16bf3009642e 100644
--- a/net/ipv4/netfilter/iptable_nat.c
+++ b/net/ipv4/netfilter/iptable_nat.c
@@ -105,7 +105,7 @@ static int __net_init iptable_nat_table_init(struct net *net)
ret = ipt_nat_register_lookups(net);
if (ret < 0) {
- ipt_unregister_table_exit(net, net->ipv4.nat_table);
+ ipt_unregister_table_exit(net, "nat");
net->ipv4.nat_table = NULL;
}
@@ -121,9 +121,7 @@ static void __net_exit iptable_nat_net_pre_exit(struct net *net)
static void __net_exit iptable_nat_net_exit(struct net *net)
{
- if (!net->ipv4.nat_table)
- return;
- ipt_unregister_table_exit(net, net->ipv4.nat_table);
+ ipt_unregister_table_exit(net, "nat");
net->ipv4.nat_table = NULL;
}