From d20ec06163e974b9f18dbee1ddde200342321c4e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 4 Feb 2009 14:22:23 +0000 Subject: improved handling of tap devices on OpenBSD --- src/bsd/tunDevice.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/bsd/tunDevice.cpp') 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)"); -- cgit v1.2.3