From f9079a110ee8336a8403efe466e2a75620c95ab1 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 17 Sep 2013 16:11:57 -0400 Subject: Make network multicast breadth/depth parameters configurable on a per-net basis. --- node/PacketDecoder.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'node/PacketDecoder.cpp') diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp index b9eb5684..ca7af0bf 100644 --- a/node/PacketDecoder.cpp +++ b/node/PacketDecoder.cpp @@ -538,14 +538,14 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared _r->multicaster->addToDedupHistory(mccrc,now); } - if (++hops >= ZT_MULTICAST_PROPAGATION_DEPTH) { + if (++hops >= network->multicastPropagationDepth()) { TRACE("not propagating MULTICAST_FRAME from original submitter %s, received from %s(%s): max depth reached",originalSubmitterAddress.toString().c_str(),source().toString().c_str(),_remoteAddress.toString().c_str()); return true; } Address upstream(source()); // save this since we might mangle it below Multicaster::MulticastBloomFilter bloom(field(ZT_PROTO_VERB_MULTICAST_FRAME_IDX_BLOOM_FILTER,ZT_PROTO_VERB_MULTICAST_FRAME_BLOOM_FILTER_SIZE_BYTES)); - SharedPtr propPeers[ZT_MULTICAST_PROPAGATION_BREADTH]; + SharedPtr propPeers[16]; unsigned int np = 0; if (_r->topology->amSupernode()) { @@ -567,7 +567,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared originalSubmitterAddress, upstream, bloom, - ZT_MULTICAST_PROPAGATION_BREADTH, + std::min(network->multicastPropagationBreadth(),(unsigned int)16), // 16 is a sanity check propPeers, now); } else if (isDuplicate) { @@ -584,7 +584,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared originalSubmitterAddress, upstream, bloom, - ZT_MULTICAST_PROPAGATION_BREADTH, + std::min(network->multicastPropagationBreadth(),(unsigned int)16), // 16 is a sanity check propPeers, now); } -- cgit v1.2.3