netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: David Miller <davem@davemloft.net>, Pravin Shelar <pshelar@nicira.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH net 1/2] vxlan: unregister on namespace exit
Date: Thu, 18 Jul 2013 08:38:26 -0700	[thread overview]
Message-ID: <20130718083826.58ae2b77@nehalam.linuxnetplumber.net> (raw)

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>


--- a/drivers/net/vxlan.c	2013-07-17 16:32:10.826955800 -0700
+++ b/drivers/net/vxlan.c	2013-07-17 16:47:35.275690741 -0700
@@ -1878,10 +1878,12 @@ static __net_exit void vxlan_exit_net(st
 {
 	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);
+	list_for_each_entry(vxlan, &vn->vxlan_list, next)
+		unregister_netdevice_queue(vxlan->dev, &list);
+	unregister_netdevice_many(&list);
 	rtnl_unlock();
 }
 

             reply	other threads:[~2013-07-18 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 15:38 Stephen Hemminger [this message]
2013-07-18 15:40 ` [PATCH net 2/2] vxlan: fix igmp races Stephen Hemminger
2013-07-18 20:15   ` David Miller
2013-07-18 16:40 ` [PATCH net 1/2] vxlan: unregister on namespace exit Pravin Shelar
2013-07-18 16:58   ` Stephen Hemminger
2013-07-18 18:28     ` Pravin Shelar
2013-07-18 20:15 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130718083826.58ae2b77@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).