summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-03-04 17:29:40 +0000
committerChristian Pointner <equinox@anytun.org>2009-03-04 17:29:40 +0000
commit7f5d02262b5477bab5aa5e54058c10aa377ce88e (patch)
tree4c6da881855222f13411c9eb99bd41f18d30c3fc
parentfixes for FreeBSD (diff)
bugfix @ BSD tunDevice
-rw-r--r--src/bsd/tun.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bsd/tun.c b/src/bsd/tun.c
index ed3eb27..f193668 100644
--- a/src/bsd/tun.c
+++ b/src/bsd/tun.c
@@ -141,8 +141,10 @@ int tun_init(tun_device_t* dev, const char* dev_name, const char* dev_type, cons
}
int ret = tun_init_post(dev);
- if(ret)
+ if(ret) {
+ tun_close(dev);
return ret;
+ }
if(ifcfg_addr)
tun_do_ifconfig(dev);