From b0e92b96877e69da1228bcb5cf69a9d0990cd4df Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 4 Feb 2009 14:19:10 +0000 Subject: improved tap device handling on openbsd --- src/bsd/tun.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- cgit v1.2.3