+#ifdef FD_CLOEXEC
+ fcntl(device_fd, F_SETFD, FD_CLOEXEC);
+#endif
+
+ struct ifreq ifr = {{{0}}};
+
+ get_config_string(lookup_config(config_tree, "DeviceType"), &type);
+
+ if(type && strcasecmp(type, "tun") && strcasecmp(type, "tap")) {
+ logger(DEBUG_ALWAYS, LOG_ERR, "Unknown device type %s!", type);
+ return false;
+ }