Skip to contentSkip to conversation

Fix kernel BUG() with iptree IP set on 2.4

PATCH New Marcus Sundberg 1 participant 1 message Jun 21, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix kernel BUG() with iptree IP set on 2.4

Hi,

The slab cache in 2.4(.31) uses a fixed length array for slab cache names, causing a BUG() in mm/slab.c:kmem_cache_create() to be triggered when attempting to create a cache who's name is longer than 18 characters. The patch below makes iptree work on 2.4 kernels as well:

//Marcus

ipv4/netfilter/ip_set_iptree.c +4 -4
@@ -472,19 +472,19 @@
 {
 	int ret;
 	
-	branch_cachep = kmem_cache_create("ip_set_iptree_branches",
+	branch_cachep = kmem_cache_create("iptree_branches",
 				sizeof(struct ip_set_iptreeb),
 				0, 0, NULL, NULL);
 	if (!branch_cachep) {
-		printk(KERN_ERR "Unable to create ip_set_iptree_branches slab cache\n");
+		printk(KERN_ERR "Unable to create iptree_branches slab cache\n");
 		ret = -ENOMEM;
 		goto out;
 	}
-	leaf_cachep = kmem_cache_create("ip_set_iptree_leaves",
+	leaf_cachep = kmem_cache_create("iptree_leaves",
 				sizeof(struct ip_set_iptreed),
 				0, 0, NULL, NULL);
 	if (!leaf_cachep) {
-		printk(KERN_ERR "Unable to create ip_set_iptree_leaves slab cache\n");
+		printk(KERN_ERR "Unable to create iptree_leaves slab cache\n");
 		ret = -ENOMEM;
 		goto free_branch;
 	}
Signature · 3 lines
---------------------------------------+--------------------------
  Marcus Sundberg <[email protected]>  | Firewalls with SIP & NAT
 Software Developer, Ingate Systems AB |  http://www.ingate.com/