Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

stephen hemminger and committed by
David S. Miller
372675a4 ecb2cf1a

+3 -1
+3 -1
drivers/net/vxlan.c
··· 1878 1878 { 1879 1879 struct vxlan_net *vn = net_generic(net, vxlan_net_id); 1880 1880 struct vxlan_dev *vxlan; 1881 + LIST_HEAD(list); 1881 1882 1882 1883 rtnl_lock(); 1883 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 1887 rtnl_unlock(); 1886 1888 } 1887 1889