All of lore.kernel.org
 help / color / mirror / Atom feed
From: jjs <jjs@tmsusa.com>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: Arnaldo Carvalho de Melo <acme@conectiva.com.br>,
	"David S. Miller" <davem@redhat.com>,
	Jeff Garzik <jgarzik@pobox.com>,
	akpm@digeo.com, netdev@oss.sgi.com
Subject: Re: [PATCH 2.5.70] Tun device encapsulation
Date: Wed, 04 Jun 2003 15:46:44 -0700	[thread overview]
Message-ID: <3EDE76D4.8070001@tmsusa.com> (raw)
In-Reply-To: 20030604154022.0ef344ff.shemminger@osdl.org

I'll be happy to test it out later -

Thanks,

Joe

Stephen Hemminger wrote:

>Tun device was encapsulating the net_device in a private structure then doing:
>	unregister_netdev(&tun->dev);
>	kfree(tun);
>	rtnl_unlock();
>
>This breaks with the delayed cleanup now in the network core.
>Moving the kfree outside of the rtnl_unlock will fix it.
>
>Builds, but not sure how to use TUN to test it.
>
>As part of later refcounting changes, I do have a more complex change
>that uses the same encapsulation as ethernet and other
>devices.  Will save it for later.
>
>diff -Nru a/drivers/net/tun.c b/drivers/net/tun.c
>--- a/drivers/net/tun.c	Wed Jun  4 15:38:44 2003
>+++ b/drivers/net/tun.c	Wed Jun  4 15:38:44 2003
>@@ -551,10 +551,12 @@
> 	if (!(tun->flags & TUN_PERSIST)) {
> 		dev_close(&tun->dev);
> 		unregister_netdevice(&tun->dev);
>-		kfree(tun);
> 	}
> 
> 	rtnl_unlock();
>+
>+	if (!(tun->flags & TUN_PERSIST)) 
>+		kfree(tun);
> 	return 0;
> }
> 
>
>  
>

  reply	other threads:[~2003-06-04 22:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030604115236.309a173d.akpm@digeo.com>
     [not found] ` <20030604212528.GA24515@conectiva.com.br>
2003-06-04 22:40   ` [PATCH 2.5.70] Tun device encapsulation Stephen Hemminger
2003-06-04 22:46     ` jjs [this message]
2003-06-05  5:33     ` Joe
2003-06-05  6:50     ` David S. 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=3EDE76D4.8070001@tmsusa.com \
    --to=jjs@tmsusa.com \
    --cc=acme@conectiva.com.br \
    --cc=akpm@digeo.com \
    --cc=davem@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.