summaryrefslogtreecommitdiff
path: root/src/bsd/tun.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bsd/tun.c')
-rw-r--r--src/bsd/tun.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bsd/tun.c b/src/bsd/tun.c
index 14b2f6e..2c07018 100644
--- a/src/bsd/tun.c
+++ b/src/bsd/tun.c
@@ -70,6 +70,12 @@ int tun_init(tun_device_t* dev, const char* dev_name, const char* dev_type, cons
asprintf(&device_file, "/dev/%s", dev_name);
dynamic = 0;
}
+#if defined(__GNUC__) && defined(__OpenBSD__)
+ else if(dev->type_ == TYPE_TUN || dev->type_ == TYPE_TAP) {
+ asprintf(&device_file, "/dev/tun");
+ actual_name_start = "tun";
+ }
+#else
else if(dev->type_ == TYPE_TUN) {
asprintf(&device_file, "/dev/tun");
actual_name_start = "tun";
@@ -78,6 +84,7 @@ int tun_init(tun_device_t* dev, const char* dev_name, const char* dev_type, cons
asprintf(&device_file, "/dev/tap");
actual_name_start = "tap";
}
+#endif
else {
log_printf(ERR, "unable to recognize type of device (tun or tap)");
tun_close(dev);