Interface auto-cloning bug or feature?

Ed Schouten ed at 80386.nl
Fri Sep 19 10:17:01 UTC 2008


Hello Maxim,

* Maxim Sobolev <sobomax at FreeBSD.org> wrote:
> 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).

I'd say the best way to fix this would be to convert tun and tap to
devfs_[gs]et_cdevpriv() and turn tun and tap into single device nodes.
That's what we've already been doing to bpf, snp, audit_pipe, etc.
Unfortunately I'm no expert when it comes to our tun and tap
implementations.

We should eventually eliminate the dev_stdclone()/clone_create()
interface. See the following URL for a list of drivers that still need
to be converted:

	http://fxr.watson.org/fxr/ident?i=D_NEEDMINOR

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20080919/209fe9cb/attachment.pgp


More information about the freebsd-current mailing list