summaryrefslogtreecommitdiff
path: root/src/anytun.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r--src/anytun.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index c4339dc..189385f 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -344,6 +344,14 @@ int main(int argc, char* argv[])
}
}
+#ifndef NOCRYPT
+#ifndef USE_SSL_CRYPTO
+// this must be called before any other libgcrypt call
+ if(!initLibGCrypt())
+ return -1;
+#endif
+#endif
+
TunDevice dev(gOpt.getDevName(), gOpt.getDevType(), gOpt.getIfconfigParamLocal(), gOpt.getIfconfigParamRemoteNetmask());
cLog.msg(Log::PRIO_NOTICE) << "dev created (opened)";
cLog.msg(Log::PRIO_NOTICE) << "dev opened - actual name is '" << dev.getActualName() << "'";
@@ -415,14 +423,6 @@ int main(int argc, char* argv[])
OptionConnectTo* connTo = new OptionConnectTo();
ThreadParam p(dev, *src, *connTo);
-#ifndef NOCRYPT
-#ifndef USE_SSL_CRYPTO
-// this must be called before any other libgcrypt call
- if(!initLibGCrypt())
- return -1;
-#endif
-#endif
-
boost::thread senderThread(boost::bind(sender,&p));
#ifndef NOSIGNALCONTROLLER
boost::thread receiverThread(boost::bind(receiver,&p));