From owner-freebsd-current@FreeBSD.ORG Fri Sep 19 10:17:01 2008 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B09551065675; Fri, 19 Sep 2008 10:17:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:3fb::211]) by mx1.freebsd.org (Postfix) with ESMTP id 7492A8FC19; Fri, 19 Sep 2008 10:17:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id D460E1CCDC; Fri, 19 Sep 2008 12:17:00 +0200 (CEST) Date: Fri, 19 Sep 2008 12:17:00 +0200 From: Ed Schouten To: Maxim Sobolev Message-ID: <20080919101700.GS81522@hoeg.nl> References: <48D2F942.4070801@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4ZVTVymsHR1TEBjP" Content-Disposition: inline In-Reply-To: <48D2F942.4070801@FreeBSD.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: "current@freebsd.org" Subject: Re: Interface auto-cloning bug or feature? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2008 10:17:01 -0000 --4ZVTVymsHR1TEBjP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Maxim, * Maxim Sobolev 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=3DD_NEEDMINOR --=20 Ed Schouten WWW: http://80386.nl/ --4ZVTVymsHR1TEBjP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjTfBwACgkQ52SDGA2eCwXQmACdFVPyQeiHBPcHy/kY18v+B/0r +w4An2f/M+xFhiR0tujV2bW6rwHp4CIE =xdMv -----END PGP SIGNATURE----- --4ZVTVymsHR1TEBjP--