Skip to contentSkip to conversation

nfnetlink_gueue: exit_net cleanup check added

PATCH Superseded Vasily Averin 1 participant 1 message Nov 5, 2017

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 15/21 nfnetlink_gueue: exit_net cleanup check added

Be sure that instance_table array initialized in net_init hook was return to initial state.

---
 net/netfilter/nfnetlink_queue.c | 8 ++++++++
 1 file changed, 8 insertions(+)
net/netfilter/nfnetlink_queue.c +8 -0
index c979662..c752eb7 100644
@@ -1512,10 +1512,18 @@ static int __net_init nfnl_queue_net_init(struct net *net)
 
 static void __net_exit nfnl_queue_net_exit(struct net *net)
 {
+	unsigned int i;
+	struct nfnl_queue_net *q = nfnl_queue_pernet(net);
+
 	nf_unregister_queue_handler(net);
 #ifdef CONFIG_PROC_FS
 	remove_proc_entry("nfnetlink_queue", net->nf.proc_netfilter);
 #endif
+	for (i = 0; i < INSTANCE_BUCKETS; i++)
+		if (WARN(!hlist_empty(&q->instance_table[i]),
+			 "net %p exit: nfnl_queue instance_table isn't empty\n",
+			 net))
+			break;
 }
 
 static void nfnl_queue_net_exit_batch(struct list_head *net_exit_list)
Signature · 1 line
2.7.4