[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e933fa0-0493-a1b4-1700-8b0763946979@virtuozzo.com>
Date: Mon, 6 Nov 2017 16:25:40 +0300
From: Vasily Averin <vvs@...tuozzo.com>
To: netdev@...r.kernel.org
Cc: Pablo Neira Ayuso <pablo@...filter.org>,
Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>,
Florian Westphal <fw@...len.de>,
netfilter-devel@...r.kernel.org, coreteam@...filter.org
Subject: [PATCH v3 18/21] x_tables: exit_net cleanup check added
Be sure that xt.tables array initialized in net_init hook was return
to initial state.
Signed-off-by: Vasily Averin <vvs@...tuozzo.com>
---
net/netfilter/x_tables.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index d8571f4..dcdaf96 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -1714,8 +1714,20 @@ static int __net_init xt_net_init(struct net *net)
return 0;
}
+static void __net_exit xt_net_exit(struct net *net)
+{
+ int i;
+
+ for (i = 0; i < NFPROTO_NUMPROTO; i++)
+ if (WARN_ONCE(!list_empty(&net->xt.tables[i]),
+ "net %x %s: tables list is not empty\n",
+ net->ns.inum. __func__)
+ break;
+}
+
static struct pernet_operations xt_net_ops = {
.init = xt_net_init,
+ .exit = xt_net_exit,
};
static int __init xt_init(void)
--
2.7.4
Powered by blists - more mailing lists