]> git.meshlink.io Git - meshlink/commitdiff
Merge branch 'master' into 1.1
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 14 Jul 2012 13:13:21 +0000 (15:13 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 14 Jul 2012 13:13:21 +0000 (15:13 +0200)
THANKS
doc/tinc.texi
src/bsd/device.c

diff --git a/THANKS b/THANKS
index 6fa8f9c869d32c6a4d7009c8c1a3f7bf73e8be08..0e7e6928c89a317b16039c422a2486aff5fdad37 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -36,6 +36,7 @@ We would like to thank the following people for their contributions to tinc:
 * Nick Hibma
 * Nick Patavalis
 * Paul Littlefield
+* Philipp Babel
 * Robert van der Meulen
 * Rumko
 * Scott Lamb
index b595aec1741f0b6ffaac91519065238513e97ab0..90d3c281588b0f7712d78d5ca8a5ec120c9dbcf8 100644 (file)
@@ -262,7 +262,7 @@ alias char-major-10-200 tun
 @subsection Configuration of FreeBSD kernels
 
 For FreeBSD version 4.1 and higher, tun and tap drivers are included in the default kernel configuration.
-Using tap devices is recommended.
+The tap driver can be loaded with @code{kldload if_tap}, or by adding @code{if_tap_load="YES"} to @file{/boot/loader.conf}. 
 
 
 @c ==================================================================
@@ -276,6 +276,7 @@ which adds a tap device to OpenBSD which should work with tinc,
 but with recent versions of OpenBSD,
 a tun device can act as a tap device by setting the link0 option with ifconfig.
 
+
 @c ==================================================================
 @node       Configuration of NetBSD kernels
 @subsection Configuration of NetBSD kernels
index f8a559686f75b7b55a2b7b1b1309450a7761a264..c50005b2661f3d2b3bed45c9070c388d69d29e1d 100644 (file)
 #include "bsd/tunemu.h"
 #endif
 
-#define DEFAULT_DEVICE "/dev/tun0"
+#define DEFAULT_TUN_DEVICE "/dev/tun0"
+#if defined(HAVE_FREEBSD) || defined(HAVE_NETBSD)
+#define DEFAULT_TAP_DEVICE "/dev/tap0"
+#else
+#define DEFAULT_TAP_DEVICE "/dev/tun0"
+#endif
 
 typedef enum device_type {
        DEVICE_TYPE_TUN,
@@ -61,8 +66,12 @@ static device_type_t device_type = DEVICE_TYPE_TUN;
 static bool setup_device(void) {
        char *type;
 
-       if(!get_config_string(lookup_config(config_tree, "Device"), &device))
-               device = xstrdup(DEFAULT_DEVICE);
+       if(!get_config_string(lookup_config(config_tree, "Device"), &device)) {
+               if(routing_mode == RMODE_ROUTER)
+                       device = xstrdup(DEFAULT_TUN_DEVICE);
+               else
+                       device = xstrdup(DEFAULT_TAP_DEVICE);
+       }
 
        if(!get_config_string(lookup_config(config_tree, "Interface"), &iface))
                iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device);