summaryrefslogtreecommitdiff
path: root/node/PacketDecoder.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-30 13:51:56 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-30 13:51:56 -0400
commit9db7939d383f2d048d48a4d78e4834fc5d2dbafe (patch)
treeba02e4b773704cd095da0bb47727ccdb7301c901 /node/PacketDecoder.cpp
parent4ecb9369b56c7aa507c9c0c9fa8381ec6772a0ea (diff)
downloadinfinitytier-9db7939d383f2d048d48a4d78e4834fc5d2dbafe.tar.gz
infinitytier-9db7939d383f2d048d48a4d78e4834fc5d2dbafe.zip
Make new multicast depth and prefix bits parameters configurable.
Diffstat (limited to 'node/PacketDecoder.cpp')
-rw-r--r--node/PacketDecoder.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp
index 1ec087c7..afc7e4fe 100644
--- a/node/PacketDecoder.cpp
+++ b/node/PacketDecoder.cpp
@@ -485,6 +485,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared
}
bool rateLimitsExceeded = false;
+ unsigned int maxDepth = ZT_MULTICAST_GLOBAL_MAX_DEPTH;
if ((origin == _r->identity.address())||(_r->mc->deduplicate(nwid,guid))) {
// Ordinary frames will drop duplicates. Supernodes keep propagating
@@ -502,6 +503,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared
// for the same frame would not be fair.
SharedPtr<Network> network(_r->nc->network(nwid));
if (network) {
+ maxDepth = network->multicastDepth(); // pull from network config if available
if (!network->isAllowed(origin)) {
TRACE("didn't inject MULTICAST_FRAME from %s(%s) into %.16llx: sender %s not allowed or we don't have a certificate",source().toString().c_str(),nwid,_remoteAddress.toString().c_str(),origin.toString().c_str());
@@ -541,7 +543,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared
TRACE("not forwarding MULTICAST_FRAME from %s(%s): depth == 0xffff (do not forward)",source().toString().c_str(),_remoteAddress.toString().c_str());
return true;
}
- if (++depth > ZT_MULTICAST_MAX_PROPAGATION_DEPTH) {
+ if (++depth > maxDepth) {
TRACE("not forwarding MULTICAST_FRAME from %s(%s): max propagation depth reached",source().toString().c_str(),_remoteAddress.toString().c_str());
return true;
}