summaryrefslogtreecommitdiff
path: root/node/PacketDecoder.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2014-01-27 23:13:36 -0800
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2014-01-27 23:13:36 -0800
commitf80ec871f6f4c63a28b9b8192477114b7aac696d (patch)
treeb2b02a40d9d9e0ee9f0dd0478fe192e966e274bc /node/PacketDecoder.cpp
parente0cb5caef21243cf045cecc25ed064869d1594d4 (diff)
downloadinfinitytier-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/PacketDecoder.cpp')
-rw-r--r--node/PacketDecoder.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp
index 4869bca5..410e273e 100644
--- a/node/PacketDecoder.cpp
+++ b/node/PacketDecoder.cpp
@@ -139,7 +139,7 @@ bool PacketDecoder::_doERROR(const RuntimeEnvironment *_r,const SharedPtr<Peer>
} else if (inReVerb == Packet::VERB_NETWORK_CONFIG_REQUEST) {
SharedPtr<Network> network(_r->nc->network(at<uint64_t>(ZT_PROTO_VERB_ERROR_IDX_PAYLOAD)));
if ((network)&&(network->controller() == source()))
- network->forceStatusTo(Network::NETWORK_NOT_FOUND);
+ network->setNotFound();
}
break;
case Packet::ERROR_IDENTITY_COLLISION:
@@ -154,7 +154,7 @@ bool PacketDecoder::_doERROR(const RuntimeEnvironment *_r,const SharedPtr<Peer>
case Packet::ERROR_NETWORK_ACCESS_DENIED_: {
SharedPtr<Network> network(_r->nc->network(at<uint64_t>(ZT_PROTO_VERB_ERROR_IDX_PAYLOAD)));
if ((network)&&(network->controller() == source()))
- network->forceStatusTo(Network::NETWORK_ACCESS_DENIED);
+ network->setAccessDenied();
} break;
default:
break;
@@ -416,7 +416,7 @@ bool PacketDecoder::_doFRAME(const RuntimeEnvironment *_r,const SharedPtr<Peer>
unsigned int etherType = at<uint16_t>(ZT_PROTO_VERB_FRAME_IDX_ETHERTYPE);
if (size() > ZT_PROTO_VERB_FRAME_IDX_PAYLOAD) {
if (network->config()->permitsEtherType(etherType)) {
- network->tap().put(source().toMAC(),network->tap().mac(),etherType,data() + ZT_PROTO_VERB_FRAME_IDX_PAYLOAD,size() - ZT_PROTO_VERB_FRAME_IDX_PAYLOAD);
+ network->tapPut(source().toMAC(),etherType,data() + ZT_PROTO_VERB_FRAME_IDX_PAYLOAD,size() - ZT_PROTO_VERB_FRAME_IDX_PAYLOAD);
} else {
TRACE("dropped FRAME from %s: ethernet type %u not allowed on network %.16llx",source().toString().c_str(),etherType,(unsigned long long)network->id());
return true;
@@ -677,7 +677,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared
TRACE("dropped MULTICAST_FRAME from %s(%s): rate limits exceeded for sender %s",source().toString().c_str(),_remoteAddress.toString().c_str(),origin.toString().c_str());
return true;
} else {
- network->tap().put(sourceMac,dest.mac(),etherType,frame,frameLen);
+ network->tapPut(sourceMac,dest.mac(),etherType,frame,frameLen);
}
}
}