diff -Nru --exclude-from /sunbeam/home/laforge/scripts/dontdiff linux-2.4.21-231039/net/core/neighbour.c linux-2.4.21-231039-debug/net/core/neighbour.c
--- linux-2.4.21-231039/net/core/neighbour.c	2004-08-02 00:36:28.000000000 +0200
+++ linux-2.4.21-231039-debug/net/core/neighbour.c	2004-08-26 13:11:05.000000000 +0200
@@ -233,14 +233,34 @@
 	if (tbl->entries > tbl->gc_thresh3 ||
 	    (tbl->entries > tbl->gc_thresh2 &&
 	     now - tbl->last_flush > 5*HZ)) {
-		if (neigh_forced_gc(tbl) == 0 &&
-		    tbl->entries > tbl->gc_thresh3)
+		int ret;
+		if (tbl->entries > tbl->gc_thresh3) {
+			if (net_ratelimit())
+				printk("%s: entries(%d) > gc_thresh3(%d)\n", __FUNCTION__, tbl->entries, tbl->gc_thresh3);
+		} else {
+			if (net_ratelimit())
+				printk("%s: entries(%d) > gc_thresh2(%d) && last_flush %lu jiffies ago\n", __FUNCTION__, tbl->entries, tbl->gc_thresh2, now - tbl->last_flush);
+		}
+		ret = neigh_forced_gc(tbl);
+		if (ret != 0) {
+			if (net_ratelimit())
+				printk("%s: neigh_forced_gc() returned %d\n", __FUNCTION__, ret);
+		}
+		
+		if (ret == 0 &&
+		    tbl->entries > tbl->gc_thresh3) {
+			if (net_ratelimit())
+				printk("%s: after gc: entries(%d) > gc_thresh3(%d)\n", __FUNCTION__, tbl->entries, tbl->gc_thresh3);
 			return NULL;
+		}
 	}
 
 	n = kmem_cache_alloc(tbl->kmem_cachep, SLAB_ATOMIC);
-	if (n == NULL)
+	if (n == NULL) {
+		if (net_ratelimit())
+			printk("%s: kmem_cache_alloc() failed\n", __FUNCTION__);
 		return NULL;
+	}
 
 	memset(n, 0, tbl->entry_size);
 
@@ -292,8 +312,11 @@
 	int error;
 
 	n = neigh_alloc(tbl);
-	if (n == NULL)
+	if (n == NULL) {
+		if (net_ratelimit())
+			printk("%s: neigh_alloc failed, returning -ENOBUFS\n", __FUNCTION__);
 		return ERR_PTR(-ENOBUFS);
+	}
 
 	memcpy(n->primary_key, pkey, key_len);
 	n->dev = dev;
@@ -302,6 +325,8 @@
 	/* Protocol specific setup. */
 	if (tbl->constructor &&	(error = tbl->constructor(n)) < 0) {
 		neigh_release(n);
+		if (net_ratelimit())
+			printk("%s: protocol constructor failed, returning %d\n", __FUNCTION__, error);
 		return ERR_PTR(error);
 	}
 
@@ -309,6 +334,8 @@
 	if (n->parms->neigh_setup &&
 	    (error = n->parms->neigh_setup(n)) < 0) {
 		neigh_release(n);
+		if (net_ratelimit())
+			printk("%s: device setup failed, returning %d\n", __FUNCTION__, error);
 		return ERR_PTR(error);
 	}
 
@@ -323,6 +350,8 @@
 			neigh_hold(n1);
 			write_unlock_bh(&tbl->lock);
 			neigh_release(n);
+			if (net_ratelimit())
+				printk("%s: race during creation, releasing new neighbour, returning reference to old\n", __FUNCTION__);
 			return n1;
 		}
 	}
diff -Nru --exclude-from /sunbeam/home/laforge/scripts/dontdiff linux-2.4.21-231039/net/core/utils.c linux-2.4.21-231039-debug/net/core/utils.c
--- linux-2.4.21-231039/net/core/utils.c	2004-08-02 00:36:28.000000000 +0200
+++ linux-2.4.21-231039-debug/net/core/utils.c	2004-08-26 13:01:39.000000000 +0200
@@ -38,12 +38,12 @@
 	net_random();
 }
 
-int net_msg_cost = 5 * USER_HZ;
+int net_msg_cost =  USER_HZ/10;
 int net_msg_burst = 10*5 * USER_HZ;
 
 /* 
- * This enforces a rate limit: not more than one kernel message
- * every 5secs to make a denial-of-service attack impossible.
+ * This enforces a rate limit: not more than ten kernel messages
+ * every second to make a denial-of-service attack unlikely.
  *
  * All warning printk()s should be guarded by this function. 
  */ 
diff -Nru --exclude-from /sunbeam/home/laforge/scripts/dontdiff linux-2.4.21-231039/net/ipv4/arp.c linux-2.4.21-231039-debug/net/ipv4/arp.c
--- linux-2.4.21-231039/net/ipv4/arp.c	2004-08-02 00:36:28.000000000 +0200
+++ linux-2.4.21-231039-debug/net/ipv4/arp.c	2004-08-26 13:13:22.000000000 +0200
@@ -461,8 +461,11 @@
 	struct net_device *dev = dst->dev;
 	struct neighbour *n = dst->neighbour;
 
-	if (dev == NULL)
+	if (dev == NULL) {
+		if (net_ratelimit())
+			printk(KERN_DEBUG "%s: dev == NULL, returning -EINVAL\n", __FUNCTION__);
 		return -EINVAL;
+	}
 	if (n == NULL) {
 		u32 nexthop = ((struct rtable*)dst)->rt_gateway;
 		if (dev->flags&(IFF_LOOPBACK|IFF_POINTOPOINT))
@@ -472,8 +475,11 @@
 		    dev->type == ARPHRD_ATM ? &clip_tbl :
 #endif
 		    &arp_tbl, &nexthop, dev);
-		if (IS_ERR(n))
+		if (IS_ERR(n)) {
+			if (net_ratelimit())
+				printk(KERN_DEBUG "%s: __neigh_lookup_errno() failed with PTR_ERR(%ld)\n", __FUNCTION__, PTR_ERR(n));
 			return PTR_ERR(n);
+		}
 		dst->neighbour = n;
 	}
 	return 0;
diff -Nru --exclude-from /sunbeam/home/laforge/scripts/dontdiff linux-2.4.21-231039/net/ipv4/route.c linux-2.4.21-231039-debug/net/ipv4/route.c
--- linux-2.4.21-231039/net/ipv4/route.c	2004-08-02 00:36:28.000000000 +0200
+++ linux-2.4.21-231039-debug/net/ipv4/route.c	2004-08-26 12:57:39.000000000 +0200
@@ -671,9 +671,13 @@
 		int err = arp_bind_neighbour(&rt->u.dst);
 		if (err) {
 			write_unlock_bh(&rt_hash_table[hash].lock);
+			if (net_ratelimit())
+				printk(KERN_DEBUG "%s: arp_bind_neighbour() failed with %d\n", __FUNCTION__, err);
 
 			if (err != -ENOBUFS) {
 				rt_drop(rt);
+				if (net_ratelimit())
+					printk(KERN_DEBUG "%s: returning since %d != -ENOBUFS\n", __FUNCTION__, err);
 				return err;
 			}
 
@@ -681,9 +685,13 @@
 			   can be released. Try to shrink route cache,
 			   it is most likely it holds some neighbour records.
 			 */
+			if (net_ratelimit())
+				printk(KERN_DEBUG "%s: attempting to do garbage collection\n", __FUNCTION__);
 			if (attempts-- > 0) {
 				int saved_elasticity = ip_rt_gc_elasticity;
 				int saved_int = __ip_rt_gc_min_interval;
+				if (net_ratelimit())
+					printk(KERN_DEBUG "%s: attempt %d\n", __FUNCTION__, attempts);
 				ip_rt_gc_elasticity	= 1;
 				__ip_rt_gc_min_interval	= 0;
 				rt_garbage_collect();
