summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--anytun.cpp4
-rw-r--r--tunDevice.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/anytun.cpp b/anytun.cpp
index d754adb..e7d5134 100644
--- a/anytun.cpp
+++ b/anytun.cpp
@@ -182,8 +182,8 @@ int main(int argc, char* argv[])
SignalController sig;
sig.init();
-
- TunDevice dev(opt.getDevName().c_str(),opt.getDevType().c_str(), opt.getIfconfigParamLocal().c_str(), opt.getIfconfigParamRemoteNetmask().c_str());
+ std::string dev_type(opt.getDevType());
+ TunDevice dev(opt.getDevName().c_str(), dev_type=="" ? NULL : dev_type.c_str(), opt.getIfconfigParamLocal().c_str(), opt.getIfconfigParamRemoteNetmask().c_str());
SeqWindow seq(opt.getSeqWindowSize());
uint8_t key[] = {
diff --git a/tunDevice.cpp b/tunDevice.cpp
index 5653bbc..40d0f9d 100644
--- a/tunDevice.cpp
+++ b/tunDevice.cpp
@@ -92,7 +92,7 @@ TunDevice::TunDevice(const char* dev_name,const char* dev_type, const char* ifcf
// lp = inet_addr("192.168.198.1");
// rp = inet_addr("192.168.199.1");
- dev_ = init_tun(dev_name, dev_type==""?NULL:dev_type, ifcfg_lp, ifcfg_rnmp, lp, rp, 0, NULL);
+ dev_ = init_tun(dev_name, dev_type, ifcfg_lp, ifcfg_rnmp, lp, rp, 0, NULL);
struct frame frame; // just for win32
struct tuntap_options options; // win32 & linux
options.txqueuelen = 100; // just for linux