X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fbsd%2Fdevice.c;h=b58db8aed6fc9358246e0bbbb7eff49a6155faf6;hp=f584355a4b00776ef9f5e07ad489d69f30add228;hb=5894e2f9be52ce96142a3f70dca1c00c265c8db3;hpb=68f4ca711593416d0defd81199b176ba604c6cb1 diff --git a/src/bsd/device.c b/src/bsd/device.c index f584355a..b58db8ae 100644 --- a/src/bsd/device.c +++ b/src/bsd/device.c @@ -1,7 +1,7 @@ /* device.c -- Interaction BSD tun/tap device Copyright (C) 2001-2005 Ivo Timmermans, - 2001-2012 Guus Sliepen + 2001-2016 Guus Sliepen 2009 Grzegorz Dymarek This program is free software; you can redistribute it and/or modify @@ -34,11 +34,7 @@ #endif #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, @@ -75,6 +71,8 @@ static bool setup_device(void) { if(!get_config_string(lookup_config(config_tree, "Interface"), &iface)) iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device); + else if(strcmp(iface, strrchr(device, '/') ? strrchr(device, '/') + 1 : device)) + logger(LOG_WARNING, "Warning: Interface does not match Device. $INTERFACE might be set incorrectly."); if(get_config_string(lookup_config(config_tree, "DeviceType"), &type)) { if(!strcasecmp(type, "tun"))