diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-04-11 08:47:02 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-04-11 08:47:02 -0700 |
commit | 88a4a3b1bae97548142b73031ff415db6ebd31d0 (patch) | |
tree | 1b1c6d58dd9c3f54ec340f6fb30d9bad14093d58 /node/Network.cpp | |
parent | 6fabaae736de2daa1ba0c22701bbb11539e3fba7 (diff) | |
download | infinitytier-88a4a3b1bae97548142b73031ff415db6ebd31d0.tar.gz infinitytier-88a4a3b1bae97548142b73031ff415db6ebd31d0.zip |
Pass tptr on leave.
Diffstat (limited to 'node/Network.cpp')
-rw-r--r-- | node/Network.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/node/Network.cpp b/node/Network.cpp index 3c607b28..b7f25f7f 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -729,7 +729,8 @@ Network::~Network() char n[128]; if (_destroyed) { - RR->node->configureVirtualNetworkPort((void *)0,_id,&_uPtr,ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY,&ctmp); + // This is done in Node::leave() so we can pass tPtr + //RR->node->configureVirtualNetworkPort((void *)0,_id,&_uPtr,ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY,&ctmp); Utils::snprintf(n,sizeof(n),"networks.d/%.16llx.conf",_id); RR->node->dataStoreDelete((void *)0,n); } else { @@ -993,6 +994,9 @@ void Network::multicastUnsubscribe(const MulticastGroup &mg) uint64_t Network::handleConfigChunk(void *tPtr,const uint64_t packetId,const Address &source,const Buffer<ZT_PROTO_MAX_PACKET_LENGTH> &chunk,unsigned int ptr) { + if (_destroyed) + return 0; + const unsigned int start = ptr; ptr += 8; // skip network ID, which is already obviously known @@ -1140,6 +1144,9 @@ uint64_t Network::handleConfigChunk(void *tPtr,const uint64_t packetId,const Add int Network::setConfiguration(void *tPtr,const NetworkConfig &nconf,bool saveToDisk) { + if (_destroyed) + return 0; + // _lock is NOT locked when this is called try { if ((nconf.issuedTo != RR->identity.address())||(nconf.networkId != _id)) @@ -1190,6 +1197,9 @@ int Network::setConfiguration(void *tPtr,const NetworkConfig &nconf,bool saveToD void Network::requestConfiguration(void *tPtr) { + if (_destroyed) + return; + /* ZeroTier addresses can't begin with 0xff, so this is used to mark controllerless * network IDs. Controllerless network IDs only support unicast IPv6 using the 6plane * addressing scheme and have the following format: 0xffSSSSEEEE000000 where SSSS |