diff options
| author | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-01-27 23:13:36 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-01-27 23:13:36 -0800 |
| commit | f80ec871f6f4c63a28b9b8192477114b7aac696d (patch) | |
| tree | b2b02a40d9d9e0ee9f0dd0478fe192e966e274bc /node/NodeConfig.cpp | |
| parent | e0cb5caef21243cf045cecc25ed064869d1594d4 (diff) | |
| download | infinitytier-f80ec871f6f4c63a28b9b8192477114b7aac696d.tar.gz infinitytier-f80ec871f6f4c63a28b9b8192477114b7aac696d.zip | |
Make EthernetTap creation occur in a background thread in Network since it's a time consuming operation on Windows. This fixes one of the last remaining Windows problems.
Diffstat (limited to 'node/NodeConfig.cpp')
| -rw-r--r-- | node/NodeConfig.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/node/NodeConfig.cpp b/node/NodeConfig.cpp index eb0802a4..acdcd49d 100644 --- a/node/NodeConfig.cpp +++ b/node/NodeConfig.cpp @@ -115,14 +115,6 @@ NodeConfig::~NodeConfig() { } -void NodeConfig::whackAllTaps() -{ - std::vector< SharedPtr<Network> > nwlist; - Mutex::Lock _l(_networks_m); - for(std::map< uint64_t,SharedPtr<Network> >::const_iterator n(_networks.begin());n!=_networks.end();++n) - n->second->tap().whack(); -} - void NodeConfig::clean() { Mutex::Lock _l(_networks_m); @@ -205,7 +197,7 @@ std::vector<std::string> NodeConfig::execute(const char *command) _P("200 listnetworks <nwid> <name> <status> <config age> <type> <dev> <ips>"); for(std::map< uint64_t,SharedPtr<Network> >::const_iterator nw(_networks.begin());nw!=_networks.end();++nw) { std::string tmp; - std::set<InetAddress> ips(nw->second->tap().ips()); + std::set<InetAddress> ips(nw->second->ips()); for(std::set<InetAddress>::iterator i(ips.begin());i!=ips.end();++i) { if (tmp.length()) tmp.push_back(','); @@ -219,13 +211,14 @@ std::vector<std::string> NodeConfig::execute(const char *command) age = 0; age /= 1000; + std::string dn(nw->second->tapDeviceName()); _P("200 listnetworks %.16llx %s %s %lld %s %s %s", (unsigned long long)nw->first, ((nconf) ? nconf->name().c_str() : "?"), Network::statusString(nw->second->status()), age, ((nconf) ? (nconf->isOpen() ? "public" : "private") : "?"), - nw->second->tap().deviceName().c_str(), + (dn.length() > 0) ? dn.c_str() : "?", ((tmp.length() > 0) ? tmp.c_str() : "-")); } } else if (cmd[0] == "join") { |
