public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.6.16.19 Fix the bug of "return 0 instead of the error code in ipt_register_table"
@ 2006-06-01 10:24 lepton
  2006-06-01 15:01 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: lepton @ 2006-06-01 10:24 UTC (permalink / raw)
  To: lkm

Hi,

There is a bug in ipt_register_table() in
net/ipv4/netfilter/ip_tables.c:

ipt_register_table() will return 0 instead of
the error code when xt_register_table() fails

Signed-off-by: Lepton Wu <ytht.net@gmail.com>

diff -prU 10 linux-2.6.16.19.oirg/net/ipv4/netfilter/ip_tables.c linux-2.6.16.19/net/ipv4/netfilter/ip_tables.c
--- linux-2.6.16.19.oirg/net/ipv4/netfilter/ip_tables.c	2006-05-31 08:31:44.000000000 +0800
+++ linux-2.6.16.19/net/ipv4/netfilter/ip_tables.c	2006-06-01 18:11:25.000000000 +0800
@@ -1235,21 +1235,22 @@ int ipt_register_table(struct xt_table *
 	ret = translate_table(table->name, table->valid_hooks,
 			      newinfo, loc_cpu_entry, repl->size,
 			      repl->num_entries,
 			      repl->hook_entry,
 			      repl->underflow);
 	if (ret != 0) {
 		xt_free_table_info(newinfo);
 		return ret;
 	}
 
-	if (xt_register_table(table, &bootstrap, newinfo) != 0) {
+	ret = xt_register_table(table, &bootstrap, newinfo);
+	if (ret) {
 		xt_free_table_info(newinfo);
 		return ret;
 	}
 
 	return 0;
 }
 
 void ipt_unregister_table(struct ipt_table *table)
 {
 	struct xt_table_info *private;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-01 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-01 10:24 [PATCH] 2.6.16.19 Fix the bug of "return 0 instead of the error code in ipt_register_table" lepton
2006-06-01 15:01 ` Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox