diff options
author | Christian Pointner <equinox@anytun.org> | 2009-02-04 14:19:10 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2009-02-04 14:19:10 +0000 |
commit | b0e92b96877e69da1228bcb5cf69a9d0990cd4df (patch) | |
tree | aabd65037e2ad56726b4e898e03bfda8e28af8a3 /src | |
parent | OpenBSD support for new ifconifg method (diff) |
improved tap device handling on openbsd
Diffstat (limited to 'src')
-rw-r--r-- | src/bsd/tun.c | 7 |
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); |