[netfilter-cvslog] r3524 - in trunk/nfsim: core core/ipv4 kernelenv

rusty at netfilter.org rusty at netfilter.org
Thu Dec 30 09:42:20 CET 2004


Author: rusty at netfilter.org
Date: 2004-12-30 09:42:19 +0100 (Thu, 30 Dec 2004)
New Revision: 3524

Modified:
   trunk/nfsim/core/core.c
   trunk/nfsim/core/core.h
   trunk/nfsim/core/failtest.c
   trunk/nfsim/core/ipv4/ipv4.c
   trunk/nfsim/kernelenv/proc_stuff.c
Log:
Found another place to suppress failures: formalize it by using an int we can simply increment and decrement for convenience.


Modified: trunk/nfsim/core/core.c
===================================================================
--- trunk/nfsim/core/core.c	2004-12-30 07:36:55 UTC (rev 3523)
+++ trunk/nfsim/core/core.c	2004-12-30 08:42:19 UTC (rev 3524)
@@ -405,7 +405,7 @@
 	}
 
 	/* Don't do failures during initialization. */
-	suppress_failtest = true;
+	suppress_failtest++;
 	kernelenv_init();
 
 	run_inits();
@@ -424,7 +424,7 @@
 	nfsim_log(LOG_UI, "initialisation done");
 
 	message_init();
-	suppress_failtest = false;
+	suppress_failtest--;
 
 	tui_run(!get_failtest(), STDIN_FILENO);
 

Modified: trunk/nfsim/core/core.h
===================================================================
--- trunk/nfsim/core/core.h	2004-12-30 07:36:55 UTC (rev 3523)
+++ trunk/nfsim/core/core.h	2004-12-30 08:42:19 UTC (rev 3524)
@@ -279,7 +279,7 @@
 bool should_i_fail(const char *func);
 bool should_i_fail_once(const char *location);
 bool get_failtest(void);
-extern bool suppress_failtest;
+extern unsigned int suppress_failtest;
 extern unsigned int failpoints;
 
 /* Proc interface. */

Modified: trunk/nfsim/core/failtest.c
===================================================================
--- trunk/nfsim/core/failtest.c	2004-12-30 07:36:55 UTC (rev 3523)
+++ trunk/nfsim/core/failtest.c	2004-12-30 08:42:19 UTC (rev 3524)
@@ -27,7 +27,7 @@
 #include <sys/wait.h>
 
 static bool failtest = false;
-bool suppress_failtest;
+unsigned int suppress_failtest;
 static unsigned int fails = 0, fails_once = 0;
 unsigned int failpoints = 0;
 

Modified: trunk/nfsim/core/ipv4/ipv4.c
===================================================================
--- trunk/nfsim/core/ipv4/ipv4.c	2004-12-30 07:36:55 UTC (rev 3523)
+++ trunk/nfsim/core/ipv4/ipv4.c	2004-12-30 08:42:19 UTC (rev 3524)
@@ -477,7 +477,7 @@
 static struct sk_buff *gather_frag(struct fraglist *f, struct sk_buff *skb)
 {
 	unsigned int i, len, off, max = 0;
-	bool old, ended = false;
+	bool ended = false;
 	char filled[70000] = { 0 };
 	char data[70000];
 
@@ -511,10 +511,9 @@
 		return NULL;
 
 	/* Copy header and data. */
-	old = suppress_failtest;
-	suppress_failtest = true;
+	suppress_failtest++;
 	skb = skb_copy_expand(f->frags[0], 0, max, GFP_KERNEL);
-	suppress_failtest = old;
+	suppress_failtest--;
 
 	skb->nh.iph = (void *)skb->data;
 	memcpy(skb->nh.iph, f->frags[0]->nh.iph, f->frags[0]->nh.iph->ihl*4);

Modified: trunk/nfsim/kernelenv/proc_stuff.c
===================================================================
--- trunk/nfsim/kernelenv/proc_stuff.c	2004-12-30 07:36:55 UTC (rev 3523)
+++ trunk/nfsim/kernelenv/proc_stuff.c	2004-12-30 08:42:19 UTC (rev 3524)
@@ -515,7 +515,10 @@
 	ret = talloc(__proc_ctx, struct ctl_table_header);
 	ret->ctl_table = table;
 
+	/* We ignore proc failures here, just like core code does. */
+	suppress_failtest++;
 	register_proc_table(table, proc_sys_root);
+	suppress_failtest--;
 	return ret;
 }
 




More information about the netfilter-cvslog mailing list