Hi,

On Tue, Aug 14, 2012 at 09:47:36PM +0200, Gert Doering wrote:
> I can see two options how to solve this:
> 
> 1 - set a flag if a device has been opened using a dynamic number 
>     ("--dev tap", which hunts for the first-free tapN device), and 
>     if yes, destroy the device on tun_close().  
> 
>     This would leave devices lingering around if you call openvpn with 
>     "--dev tap3" and there has not been a "tap3" before - but this could 
>     be documented as "intended behaviour", and it would be fairly 
>     straightforward to implement.
> 
> 2 - actually check for "--dev tap3" whether it exists before (by calling
>     "ifconfig tap3" and checking the error return code - accessing /dev/tap3
>     will not work, as that *always* springs the device to life), and 
>     destroy devices that we newly created, while leaving alone devices that
>     have been there before.
> 
>     This will have the most nice user experience ("always leave the system
>     as it was before"), but the implementation would mess up tun.c somewhat
>     more.

  3 - check for the existance of "--dev tap3" and remember, not cleaning
      if it existed previously, doing this with RT_NETLINK which should
      be sufficiently portable across all BSDs.  Same advantage as "2",
      hopefully much nicer implementation.

I'll see whether I can get "3" done in sufficiently nice code...

gert

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             g...@greenie.muc.de
fax: +49-89-35655025                        g...@net.informatik.tu-muenchen.de

Attachment: pgpdxNGarcoXw.pgp
Description: PGP signature

Reply via email to