summaryrefslogtreecommitdiff
path: root/net/netfilter/x_tables.c
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2017-11-12 14:32:37 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2017-11-20 12:03:41 +0100
commit613d0776d3fe7eb28c695a63a5533a1ec8258c86 (patch)
tree08d9707ea53ccf351385ada525aeb3f250ccb6fd /net/netfilter/x_tables.c
parent07dc8bc9a6b15f54d3ad962af74a096c7d7b42b4 (diff)
netfilter: exit_net cleanup check added
Be sure that lists initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/x_tables.c')
-rw-r--r--net/netfilter/x_tables.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index a77dd514297c..55802e97f906 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -1729,8 +1729,17 @@ 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++)
+ WARN_ON_ONCE(!list_empty(&net->xt.tables[i]));
+}
+
static struct pernet_operations xt_net_ops = {
.init = xt_net_init,
+ .exit = xt_net_exit,
};
static int __init xt_init(void)