Skip to content

Commit

Permalink
l2tp: exit_net cleanup check added
Browse files Browse the repository at this point in the history
Be sure that l2tp_session_hlist array initialized in net_init hook
was return to initial state.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
vaverin authored and davem330 committed Nov 14, 2017
1 parent ce2b7db commit 1e7af3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/l2tp/l2tp_core.c
Expand Up @@ -1833,6 +1833,7 @@ static __net_exit void l2tp_exit_net(struct net *net)
{
struct l2tp_net *pn = l2tp_pernet(net);
struct l2tp_tunnel *tunnel = NULL;
int hash;

rcu_read_lock_bh();
list_for_each_entry_rcu(tunnel, &pn->l2tp_tunnel_list, list) {
Expand All @@ -1842,6 +1843,9 @@ static __net_exit void l2tp_exit_net(struct net *net)

flush_workqueue(l2tp_wq);
rcu_barrier();

for (hash = 0; hash < L2TP_HASH_SIZE_2; hash++)
WARN_ON_ONCE(!hlist_empty(&pn->l2tp_session_hlist[hash]));
}

static struct pernet_operations l2tp_net_ops = {
Expand Down

0 comments on commit 1e7af3b

Please sign in to comment.