summaryrefslogtreecommitdiff
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2013-07-18 15:38:26 (GMT)
committerDavid S. Miller <davem@davemloft.net>2013-07-20 00:07:25 (GMT)
commit372675a4a9ac0a0af962d44dadeea69926ce45e0 (patch)
treef868cc003185ec9fda2144d810b00d4a223ebd1a /drivers/net/vxlan.c
parentecb2cf1a6b63825a258ff4fe0d7f3070fbe4676b (diff)
downloadlinux-fsl-qoriq-372675a4a9ac0a0af962d44dadeea69926ce45e0.tar.xz
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: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r--drivers/net/vxlan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index a5ba8dd..f101034 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -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();
}