diff options
author | stephen hemminger <stephen@networkplumber.org> | 2013-07-18 11:38:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-19 20:07:25 -0400 |
commit | 372675a4a9ac0a0af962d44dadeea69926ce45e0 (patch) | |
tree | f868cc003185ec9fda2144d810b00d4a223ebd1a | |
parent | ecb2cf1a6b63825a258ff4fe0d7f3070fbe4676b (diff) |
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>
-rw-r--r-- | drivers/net/vxlan.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index a5ba8dd7e6be..f101034a297a 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) | |||
1878 | { | 1878 | { |
1879 | struct vxlan_net *vn = net_generic(net, vxlan_net_id); | 1879 | struct vxlan_net *vn = net_generic(net, vxlan_net_id); |
1880 | struct vxlan_dev *vxlan; | 1880 | struct vxlan_dev *vxlan; |
1881 | LIST_HEAD(list); | ||
1881 | 1882 | ||
1882 | rtnl_lock(); | 1883 | rtnl_lock(); |
1883 | list_for_each_entry(vxlan, &vn->vxlan_list, next) | 1884 | list_for_each_entry(vxlan, &vn->vxlan_list, next) |
1884 | dev_close(vxlan->dev); | 1885 | unregister_netdevice_queue(vxlan->dev, &list); |
1886 | unregister_netdevice_many(&list); | ||
1885 | rtnl_unlock(); | 1887 | rtnl_unlock(); |
1886 | } | 1888 | } |
1887 | 1889 | ||