Commit f68772ed authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso
Browse files

netfilter: x_tables: remove paranoia tests



No need for these.
There is only one caller, the xtables core, when the table is registered
for the first time with a particular network namespace.

After ->table_init() call, the table is linked into the tables[af] list,
so next call to that function will skip the ->table_init().

Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 4d705399
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -44,9 +44,6 @@ static int __net_init arptable_filter_table_init(struct net *net)
	struct arpt_replace *repl;
	int err;

	if (net->ipv4.arptable_filter)
		return 0;

	repl = arpt_alloc_initial_table(&packet_filter);
	if (repl == NULL)
		return -ENOMEM;
+0 −3
Original line number Diff line number Diff line
@@ -48,9 +48,6 @@ static int __net_init iptable_filter_table_init(struct net *net)
	struct ipt_replace *repl;
	int err;

	if (net->ipv4.iptable_filter)
		return 0;

	repl = ipt_alloc_initial_table(&packet_filter);
	if (repl == NULL)
		return -ENOMEM;
+0 −3
Original line number Diff line number Diff line
@@ -88,9 +88,6 @@ static int __net_init iptable_mangle_table_init(struct net *net)
	struct ipt_replace *repl;
	int ret;

	if (net->ipv4.iptable_mangle)
		return 0;

	repl = ipt_alloc_initial_table(&packet_mangler);
	if (repl == NULL)
		return -ENOMEM;
+0 −3
Original line number Diff line number Diff line
@@ -90,9 +90,6 @@ static int __net_init iptable_nat_table_init(struct net *net)
	struct ipt_replace *repl;
	int ret;

	if (net->ipv4.nat_table)
		return 0;

	repl = ipt_alloc_initial_table(&nf_nat_ipv4_table);
	if (repl == NULL)
		return -ENOMEM;
+0 −3
Original line number Diff line number Diff line
@@ -55,9 +55,6 @@ static int __net_init iptable_raw_table_init(struct net *net)
	if (raw_before_defrag)
		table = &packet_raw_before_defrag;

	if (net->ipv4.iptable_raw)
		return 0;

	repl = ipt_alloc_initial_table(table);
	if (repl == NULL)
		return -ENOMEM;
Loading