]> tinc-vpn.org Git - tinc/blobdiff - src/bsd/device.c
Ignore the Interface option if device rename is impossible.
[tinc] / src / bsd / device.c
index 0e795dd06e31b22ba0a9bcca03f628f45aadc85b..cb65dbbf307484d1cd9c4dc5fdbe832c1bc3d278 100644 (file)
@@ -73,6 +73,15 @@ static bool setup_device(void) {
        }
 
        if(!get_config_string(lookup_config(config_tree, "Interface"), &iface))
        }
 
        if(!get_config_string(lookup_config(config_tree, "Interface"), &iface))
+               iface = NULL;
+#ifndef TAPGIFNAME
+       if (iface) {
+               logger(DEBUG_ALWAYS, LOG_WARNING, "Ignoring specified interface name '%s' as device rename is not supported on this platform", iface);
+               free(iface);
+               iface = NULL;
+       }
+#endif
+       if (!iface)
                iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device);
 
        if(get_config_string(lookup_config(config_tree, "DeviceType"), &type)) {
                iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device);
 
        if(get_config_string(lookup_config(config_tree, "DeviceType"), &type)) {