diff options
author | Othmar Gsenger <otti@anytun.org> | 2010-01-10 22:10:05 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2010-01-10 22:10:05 +0000 |
commit | 2f418d7ab9f44ee8d573a81a08c167dbf46f1658 (patch) | |
tree | d4d6d38b11fda9ee17b1e4448f8dc1b7ffcc7c32 /src/linux/tunDevice.cpp | |
parent | dispatching right socket for send to function (diff) |
fixed priviledge dropping on freebsd
maybee todo: remove old non working preprocessor staments like NO_EXEC to make code simpler
Diffstat (limited to 'src/linux/tunDevice.cpp')
-rw-r--r-- | src/linux/tunDevice.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/linux/tunDevice.cpp b/src/linux/tunDevice.cpp index 57b1c7c..c351683 100644 --- a/src/linux/tunDevice.cpp +++ b/src/linux/tunDevice.cpp @@ -50,7 +50,7 @@ #include "anytunError.h" #include "sysExec.h" -TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifcfg_addr, u_int16_t ifcfg_prefix) : conf_(dev_name, dev_type, ifcfg_addr, ifcfg_prefix, 1400) +TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifcfg_addr, u_int16_t ifcfg_prefix) : conf_(dev_name, dev_type, ifcfg_addr, ifcfg_prefix, 1400), sys_exec_(NULL) { struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); @@ -158,8 +158,16 @@ void TunDevice::init_post() void TunDevice::do_ifconfig() { +#ifndef NO_EXEC std::ostringstream mtu_ss; mtu_ss << conf_.mtu_; StringVector args = boost::assign::list_of(actual_name_)(conf_.addr_.toString())("netmask")(conf_.netmask_.toString())("mtu")(mtu_ss.str()); - anytun_exec("/sbin/ifconfig", args); + sys_exec_ = new SysExec("/sbin/ifconfig", args); +#endif +} + +void TunDevice::waitForPostUpScript() +{ + if (sys_exec_) + sys_exec_->waitForScript(); } |