提交 372675a4 编写于 作者: S stephen hemminger 提交者: David S. Miller

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: NStephen Hemminger <stephen@networkplumber.org>
Reviewed-by: NPravin B Shelar <pshelar@nicira.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ecb2cf1a
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册