Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 May 2001 11:21:41 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Brian Somers <brian@Awfulhak.org>
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   Re: How to handle cloning in a pseudo device. 
Message-ID:  <598.991214501@critter>
In-Reply-To: Your message of "Wed, 30 May 2001 10:15:09 BST." <200105300915.f4U9F9H32416@hak.lan.Awfulhak.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200105300915.f4U9F9H32416@hak.lan.Awfulhak.org>, Brian Somers write
s:
>> What you should do when people try to acccess /dev/tun is to
>> create a hitherto unopened unit on the tunnel and mark the
>> dev_t "CHEAP_CLONE".
>> 
>> If people just do an ls -l /dev/tun they get a random line
>> and that dev_t will be GC'ed pretty quickly.
>
>The problem I had was this:
>
>  $ sudo kldload if_tun
>  $ touch /dev/tun
>  $ sudo kldunload if_tun
>  $ ls -l /dev/tun*
>
>The machine froze at that point - I assumed because if_tun hadn't 
>destroy_dev()d tun0 (I haven't got the code any more so I can't give 
>any more info right now).

You shouldn't need timeouts or anything it should be all transparent.

The only thing we may be missing is to silence the "Driver mistake"
warning if you make_dev() a CHEAP_CLONE device twice...

But the easiest way to get further is probably if you show me your
patches...

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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