Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 2008 10:42:01 +0200
From:      "Alexey Shuvaev" <shuvaev@physik.uni-wuerzburg.de>
To:        freebsd-current@freebsd.org
Subject:   Re: Interface auto-cloning bug or feature?
Message-ID:  <20080919084201.GD44330@wep4035.physik.uni-wuerzburg.de>
In-Reply-To: <48D2F942.4070801@FreeBSD.org>
References:  <48D2F942.4070801@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 18, 2008 at 05:58:42PM -0700, Maxim Sobolev wrote:
> Hi,
>
> I've noticed that stat/open call on /dev/tun always creates new
> interface, despite the fact that existing spare interfaces may be
> available. I believe that it's a bug, since the whole purpose of
> auto-cloning is to create new instance only when no existing one could
> be allocated. At least that's my reading of the manual page for the tun(4).
>
> <quote>
>      If the sysctl(8) variable net.link.tun.devfs_cloning is non-zero,
> the tun
>      interface permits opens on the special control device /dev/tun.  When
>      this device is opened, tun will return a handle for the lowest
> unused tun
>      device (use devname(3) to determine which).
> </quote>
>
> -Maxim
>
> [root@sp1 /usr/home/sobomax]# ifconfig -a
> tun0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> [root@sp1 /usr/home/sobomax]# stat /dev/tun
> 67174144 96 crw------- 1 uucp dialer 96 0 "May  2 22:21:28 2008" "May  2
> 22:21:28 2008" "May  2 22:21:28 2008" "Dec 31 23:59:59 1969" 4096 0 0
> /dev/tun
> [root@sp1 /usr/home/sobomax]# ifconfig -a
> tun0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> tun1: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> [root@sp1 /usr/home/sobomax]# stat /dev/tun
> 67174144 99 crw------- 1 uucp dialer 99 0 "May  2 22:21:28 2008" "May  2
> 22:21:28 2008" "May  2 22:21:28 2008" "Dec 31 23:59:59 1969" 4096 0 0
> /dev/tun
> [root@sp1 /usr/home/sobomax]# ifconfig -a
> tun0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> tun1: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> tun2: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> [root@sp1 /usr/home/sobomax]# stat /dev/tun
> 67174144 105 crw------- 1 uucp dialer 105 0 "May  2 22:21:28 2008" "May
>  2 22:21:28 2008" "May  2 22:21:28 2008" "Dec 31 23:59:59 1969" 4096 0
> 0 /dev/tun
> [root@sp1 /usr/home/sobomax]# ifconfig -a
> tun0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> tun1: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> tun2: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
> tun3: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
>
Me too.
I have seen that using ppp(8) and security/vpnc.

Alexey.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080919084201.GD44330>