summaryrefslogtreecommitdiff
path: root/src/bsd
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-02-04 14:22:23 +0000
committerChristian Pointner <equinox@anytun.org>2009-02-04 14:22:23 +0000
commitd20ec06163e974b9f18dbee1ddde200342321c4e (patch)
tree5907edff252b3dc4b4d87d7f4643b007cb28cb9f /src/bsd
parentadded fix for new ifconfig method from uanytun (diff)
improved handling of tap devices on OpenBSD
Diffstat (limited to 'src/bsd')
-rw-r--r--src/bsd/tunDevice.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bsd/tunDevice.cpp b/src/bsd/tunDevice.cpp
index 29fe971..05b59f1 100644
--- a/src/bsd/tunDevice.cpp
+++ b/src/bsd/tunDevice.cpp
@@ -57,6 +57,12 @@ TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifc
device_file.append(dev_name);
dynamic = false;
}
+#if defined(__GNUC__) && defined(__OpenBSD__)
+ else if(conf_.type_ == TYPE_TUN || conf_.type_ == TYPE_TAP) {
+ device_file.append("tun");
+ actual_name_ = "tun";
+ }
+#else
else if(conf_.type_ == TYPE_TUN) {
device_file.append("tun");
actual_name_ = "tun";
@@ -65,6 +71,7 @@ TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifc
device_file.append("tap");
actual_name_ = "tap";
}
+#endif
else
throw std::runtime_error("unable to recognize type of device (tun or tap)");