Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 372675a4 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller
Browse files

vxlan: unregister on namespace exit



Fix memory leaks and other badness from VXLAN network namespace
teardown. When network namespace is removed, all the vxlan devices should
be unregistered (not closed).

Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Reviewed-by: default avatarPravin B Shelar <pshelar@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ecb2cf1a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1878,10 +1878,12 @@ static __net_exit void vxlan_exit_net(struct net *net)
{
	struct vxlan_net *vn = net_generic(net, vxlan_net_id);
	struct vxlan_dev *vxlan;
	LIST_HEAD(list);

	rtnl_lock();
	list_for_each_entry(vxlan, &vn->vxlan_list, next)
		dev_close(vxlan->dev);
		unregister_netdevice_queue(vxlan->dev, &list);
	unregister_netdevice_many(&list);
	rtnl_unlock();
}