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"))
get_config_string(lookup_config(config_tree, "Device"), &device);
get_config_string(lookup_config(config_tree, "Interface"), &iface);
+ if(device && interface)
+ logger(LOG_WARNING, "Warning: both Device and Interface specified, results may not be as expected");
+
/* Open registry and look for network adapters */
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, NETWORK_CONNECTIONS_KEY, 0, KEY_READ, &key)) {
get_config_string(lookup_config(config_tree, "Device"), &device);
get_config_string(lookup_config(config_tree, "Interface"), &iface);
+ if(device && interface)
+ logger(LOG_WARNING, "Warning: both Device and Interface specified, results may not be as expected");
+
/* Open registry and look for network adapters */
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, NETWORK_CONNECTIONS_KEY, 0, KEY_READ, &key)) {