Skip to content

Commit

Permalink
vxlan: exit_net cleanup checks added
Browse files Browse the repository at this point in the history
Be sure that sock_list 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
Vasily Averin authored and David S. Miller committed Nov 14, 2017
1 parent 669f8f1 commit 0e4ec5a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -3704,6 +3704,7 @@ static void __net_exit vxlan_exit_net(struct net *net)
struct vxlan_net *vn = net_generic(net, vxlan_net_id);
struct vxlan_dev *vxlan, *next;
struct net_device *dev, *aux;
unsigned int h;
LIST_HEAD(list);

rtnl_lock();
Expand All @@ -3723,6 +3724,9 @@ static void __net_exit vxlan_exit_net(struct net *net)

unregister_netdevice_many(&list);
rtnl_unlock();

for (h = 0; h < PORT_HASH_SIZE; ++h)
WARN_ON_ONCE(!hlist_empty(&vn->sock_list[h]));
}

static struct pernet_operations vxlan_net_ops = {
Expand Down

0 comments on commit 0e4ec5a

Please sign in to comment.