[PATCH] IP Firewalling crashes some SMP boxen

Paul Rusty Russell (Paul.Russell@rustcorp.com.au)
Tue, 29 Dec 1998 17:17:08 +1130


Hi Linus, you missed this critical patch for 2.2.0-pre1. There's one
more important 5-line firewall patch I want in (want to do more
testing here, even though it's trivial it's a corner case), and that's
it.

---- linux/net/ipv4/ip_fw.c.~3~ Tue Oct 13 14:02:32 1998
+++ linux/net/ipv4/ip_fw.c Mon Dec 7 17:15:01 1998
@@ -115,8 +115,8 @@
* UP.
*
* For backchains and counters, we use an array, indexed by
- * [smp_processor_id()*2 + !in_interrupt()]; the array is of size
- * [smp_num_cpus*2]. For v2.0, smp_num_cpus is effectively 1. So,
+ * [cpu_number_map[smp_processor_id()]*2 + !in_interrupt()]; the array is of
+ * size [smp_num_cpus*2]. For v2.0, smp_num_cpus is effectively 1. So,
* confident of uniqueness, we modify counters even though we only
* have a read lock (to read the counters, you need a write lock,
* though). */
@@ -140,7 +140,11 @@
static struct sock *ipfwsk;
#endif

-#define SLOT_NUMBER() (smp_processor_id()*2 + !in_interrupt())
+#ifdef __SMP__
+#define SLOT_NUMBER() (cpu_number_map[smp_processor_id()]*2 + !in_interrupt())
+#else
+#define SLOT_NUMBER() (!in_interrupt())
+#endif
#define NUM_SLOTS (smp_num_cpus*2)

#define SIZEOF_STRUCT_IP_CHAIN (sizeof(struct ip_chain) \

--
 .sig lost in the mail.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/