diff options
author | Grant Limberg <grant.limberg@zerotier.com> | 2019-06-17 15:32:27 -0700 |
---|---|---|
committer | Grant Limberg <grant.limberg@zerotier.com> | 2019-06-17 15:32:27 -0700 |
commit | 21e844cd82f8b6bb03f51de996f5fb91cd3fe1f6 (patch) | |
tree | fc76dc87732d90e81472caa2bf1a478e400cb99d /node/Network.cpp | |
parent | 4e2439bd127c399bc31a44611c5226ed51681728 (diff) | |
parent | c5a07c7f20dc54d88a2f6b8b5c4462510b042325 (diff) | |
download | infinitytier-21e844cd82f8b6bb03f51de996f5fb91cd3fe1f6.tar.gz infinitytier-21e844cd82f8b6bb03f51de996f5fb91cd3fe1f6.zip |
Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev
Diffstat (limited to 'node/Network.cpp')
-rw-r--r-- | node/Network.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/node/Network.cpp b/node/Network.cpp index 92b10671..1e151b61 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -1036,7 +1036,7 @@ int Network::setConfiguration(void *tPtr,const NetworkConfig &nconf,bool saveToD _portError = RR->node->configureVirtualNetworkPort(tPtr,_id,&_uPtr,(oldPortInitialized) ? ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE : ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_UP,&ctmp); if (saveToDisk) { - Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY> *d = new Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY>(); + Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY> *const d = new Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY>(); try { if (nconf.toDictionary(*d,false)) { uint64_t tmp[2]; @@ -1493,25 +1493,27 @@ void Network::_sendUpdatesToMembers(void *tPtr,const MulticastGroup *const newMu void Network::_announceMulticastGroupsTo(void *tPtr,const Address &peer,const std::vector<MulticastGroup> &allMulticastGroups) { // Assumes _lock is locked - Packet outp(peer,RR->identity.address(),Packet::VERB_MULTICAST_LIKE); + Packet *const outp = new Packet(peer,RR->identity.address(),Packet::VERB_MULTICAST_LIKE); for(std::vector<MulticastGroup>::const_iterator mg(allMulticastGroups.begin());mg!=allMulticastGroups.end();++mg) { - if ((outp.size() + 24) >= ZT_PROTO_MAX_PACKET_LENGTH) { - outp.compress(); - RR->sw->send(tPtr,outp,true); - outp.reset(peer,RR->identity.address(),Packet::VERB_MULTICAST_LIKE); + if ((outp->size() + 24) >= ZT_PROTO_MAX_PACKET_LENGTH) { + outp->compress(); + RR->sw->send(tPtr,*outp,true); + outp->reset(peer,RR->identity.address(),Packet::VERB_MULTICAST_LIKE); } // network ID, MAC, ADI - outp.append((uint64_t)_id); - mg->mac().appendTo(outp); - outp.append((uint32_t)mg->adi()); + outp->append((uint64_t)_id); + mg->mac().appendTo(*outp); + outp->append((uint32_t)mg->adi()); } - if (outp.size() > ZT_PROTO_MIN_PACKET_LENGTH) { - outp.compress(); - RR->sw->send(tPtr,outp,true); + if (outp->size() > ZT_PROTO_MIN_PACKET_LENGTH) { + outp->compress(); + RR->sw->send(tPtr,*outp,true); } + + delete outp; } std::vector<MulticastGroup> Network::_allMulticastGroups() const |