netdev
[Top] [All Lists]

Re: "new style" netdevice allocation patch for TUN driver (2.4.18 kernel

To: kuznet@xxxxxxxxxxxxx
Subject: Re: "new style" netdevice allocation patch for TUN driver (2.4.18 kernel)
From: Jacek Konieczny <jajcus@xxxxxxx>
Date: Thu, 1 Aug 2002 19:52:06 +0200
Cc: netdev@xxxxxxxxxxx
In-reply-to: <200208011743.VAA07150@sex.inr.ac.ru>
Mail-followup-to: kuznet@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
References: <20020801133506.GA22073@serwus.bnet.pl> <200208011743.VAA07150@sex.inr.ac.ru>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.3.99i
On Thu, Aug 01, 2002 at 09:43:23PM +0400, kuznet@xxxxxxxxxxxxx wrote:
> Hello!
> 
> > network. And "unregister_netdevice: waiting for tun0 to become free"
> 
> This smells like a leakage. I think this should be investigated.
I am not sure. Sometimes it is not easy to free such device.

> > devices, and that only the "old style" devices have this problem.
> > I had similar problem with VLAN devices some time ago, so I checked VLAN
> > driver sources too.
> 
> Well, switching to "new style" does not solve the problem. If we have
> a leakage, it will continue silently which is even worse.
> Probably, you should to define NET_REFCNT_DEBUG in net/core/dev.c
> to track what happens with the device.
After applying my patch, the device unregistration is usually defered,
but finally it is finished. On system shutdown, when all routes are
removed, all interfaces downed and all processes killed the device will
not be used any more and the device is freed. Without the patch my
system doesn't even come to this point, as it stops on the first process
which tries to access any network device (eg. any iproute2 command).
Usually it stops on postfix shutdown. Probably because I use the tun
device for tunneling SMTP connections to my home machine. Probably
shutting down postfix before openvpn would help, but failing to do this
should not hang the system.

And even if there is a bug in tun module it should never prevent system
from clean shutdown. Even if the device will be never freed and module
unloaded. So I thing this patch (or similar) should be applied.

Greets,
        Jacek


<Prev in Thread] Current Thread [Next in Thread>