浏览代码

[NETFILTER] Free layer-3 specific protocol tables at cleanup

Although the comment around the allocation code tells us that
the layer-3 specific protocol tables will be freed when cleaning up,
they aren't. And this makes nfsim complain loudly...

Signed-off-by: KOVACS Krisztian <hidden@balabit.hu>
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
KOVACS Krisztian 19 年之前
父节点
当前提交
5a6f294e43
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      net/netfilter/nf_conntrack_core.c

+ 7 - 0
net/netfilter/nf_conntrack_core.c

@@ -1395,6 +1395,13 @@ void nf_conntrack_cleanup(void)
 	kmem_cache_destroy(nf_conntrack_expect_cachep);
 	kmem_cache_destroy(nf_conntrack_expect_cachep);
 	free_conntrack_hash(nf_conntrack_hash, nf_conntrack_vmalloc,
 	free_conntrack_hash(nf_conntrack_hash, nf_conntrack_vmalloc,
 			    nf_conntrack_htable_size);
 			    nf_conntrack_htable_size);
+
+	/* free l3proto protocol tables */
+	for (i = 0; i < PF_MAX; i++)
+		if (nf_ct_protos[i]) {
+			kfree(nf_ct_protos[i]);
+			nf_ct_protos[i] = NULL;
+		}
 }
 }
 
 
 static struct list_head *alloc_hashtable(int size, int *vmalloced)
 static struct list_head *alloc_hashtable(int size, int *vmalloced)