Finding the right interface on FreeBSD

Gaël Roualland gael.roualland at dial.oleane.com
Wed Jun 7 10:26:18 CEST 2006


Guus Sliepen a écrit :
>> I tried that indeed, buf for some reason, some devices stay busy after
>> being used (eg if tinc crashes, cf my other report).
>> I have not investigated this a great length (could be a freebsd bug
>> instead perhaps) but I found it usefull that tinc could try to find an
>> inetrface on its own, just like it does on Linux for instance.
> 
> It doesn't do that on Linux. On Linux, there is only one /dev/tun, but
> multiple programs can open it simultaneously. 

Yes, I just meant that to the end user it behaves in a similar way (the
config has a generic name and the real device gets allocated at runtime,
but by the kernel). However, the way I added this makes it impossible to
force tincd on a specific interface and fail if it's in use. So maybe
another way of turning it on should be better (a wildcard perhaps).

> But it seems very odd to
> me that a crashing program can keep a tun device busy on FreeBSD. Maybe
> you can try "ifconfig tun0 down" before restarting tinc (with 0 replaced
> by the actual number it used)?
> If that doesn't help either, I'd say it is a kernel bug.

I tried that, and ifconfig doesn't help. Indeed it is probably a bug
that the device stays busy after exit, but I have not investigated this
further yet.
However, I found it usefull to be able to find a free interface
automatically, skipping busy ones (being that they are used by another
process, or victims of a kernel bug, or whatever makes sense to the system).
Now, you make the call ;)

HTH,

-- 
Gaël Roualland -+- gael.roualland at dial.oleane.com


More information about the tinc-devel mailing list