summaryrefslogtreecommitdiff
path: root/src/anytun.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-01-15 16:40:41 +0000
committerChristian Pointner <equinox@anytun.org>2009-01-15 16:40:41 +0000
commit95a317d43f0d101013593fd2c1af00e7865f98cd (patch)
tree0d478683f1359051f219f1283979557dc1d71877 /src/anytun.cpp
parentlog class can now easily use errno and gpg_err (diff)
added a workaround for strerror_r problem
moved initLibGcrypt to right position (needs to be called before any other libgcrypt call)
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));