summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-03-05 00:27:28 +0000
committerChristian Pointner <equinox@anytun.org>2009-03-05 00:27:28 +0000
commit55c299b7ad1e2919c54ba1d5fb61b1103fe16883 (patch)
tree2f2528d11bd9f3490e7490bf81182910d6f6590e /src
parentfixed tunDev-- Diese und die folgenden Zeilen werden ignoriert -- (diff)
moved sync thread creation before priv.drop to allow bind on privileged ports
Diffstat (limited to 'src')
-rw-r--r--src/anytun.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index da2f7f6..088b7ad 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -467,6 +467,18 @@ int main(int argc, char* argv[])
disableRouting=true;
}
#endif
+
+#ifndef ANYTUN_NOSYNC
+ boost::thread * syncListenerThread;
+ if(gOpt.getLocalSyncPort() != "")
+ syncListenerThread = new boost::thread(boost::bind(syncListener));
+
+ std::list<boost::thread *> connectThreads;
+ for(HostList::const_iterator it = connect_to.begin() ;it != connect_to.end(); ++it) {
+ connectThreads.push_back(new boost::thread(boost::bind(syncConnector, *it)));
+ }
+#endif
+
#ifndef NO_DAEMON
if(gOpt.getChrootDir() != "")
do_chroot(gOpt.getChrootDir());
@@ -489,16 +501,6 @@ int main(int argc, char* argv[])
#if defined(WIN_SERVICE) || !defined(NO_SIGNALCONTROLLER)
boost::thread receiverThread(boost::bind(receiver, &dev, src));
#endif
-#ifndef ANYTUN_NOSYNC
- boost::thread * syncListenerThread;
- if(gOpt.getLocalSyncPort() != "")
- syncListenerThread = new boost::thread(boost::bind(syncListener));
-
- std::list<boost::thread *> connectThreads;
- for(HostList::const_iterator it = connect_to.begin() ;it != connect_to.end(); ++it) {
- connectThreads.push_back(new boost::thread(boost::bind(syncConnector, *it)));
- }
-#endif
#if defined(WIN_SERVICE)
int ret = 0;