summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-10 14:59:07 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-10 14:59:07 -0700
commite071c05f1b831ed108441e49c651d617749940d2 (patch)
treec33315a64e78b3aa2c490246bac48612fb36c092
parent03dc823ad7732fde2ccfa30446778fa229d69760 (diff)
downloadinfinitytier-e071c05f1b831ed108441e49c651d617749940d2.tar.gz
infinitytier-e071c05f1b831ed108441e49c651d617749940d2.zip
Add a sanity limit to legacy multicast repeater function in supernode-mode nodes, and change netconf-master to issue multicast limit (ml) instead of old p5 stuff.
-rw-r--r--netconf-service/netconf-master.js9
-rw-r--r--netconf-service/redis-schema.md4
-rw-r--r--node/IncomingPacket.cpp3
3 files changed, 7 insertions, 9 deletions
diff --git a/netconf-service/netconf-master.js b/netconf-service/netconf-master.js
index f5c0d223..fb32bc60 100644
--- a/netconf-service/netconf-master.js
+++ b/netconf-service/netconf-master.js
@@ -32,8 +32,7 @@ var ZT_NETWORKCONFIG_DICT_KEY_ALLOWED_ETHERNET_TYPES = "et";
var ZT_NETWORKCONFIG_DICT_KEY_NETWORK_ID = "nwid";
var ZT_NETWORKCONFIG_DICT_KEY_TIMESTAMP = "ts";
var ZT_NETWORKCONFIG_DICT_KEY_ISSUED_TO = "id";
-var ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_PREFIX_BITS = "mpb";
-var ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_DEPTH = "md";
+var ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_LIMIT = "ml";
var ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_RATES = "mr";
var ZT_NETWORKCONFIG_DICT_KEY_PRIVATE = "p";
var ZT_NETWORKCONFIG_DICT_KEY_NAME = "n";
@@ -532,10 +531,8 @@ function doNetconfRequest(message)
netconf.data[ZT_NETWORKCONFIG_DICT_KEY_NETWORK_ID] = nwid;
netconf.data[ZT_NETWORKCONFIG_DICT_KEY_TIMESTAMP] = Date.now().toString(16);
netconf.data[ZT_NETWORKCONFIG_DICT_KEY_ISSUED_TO] = peerId.address();
- if (network['p5MulticastPrefixBits'])
- netconf.data[ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_PREFIX_BITS] = network['p5MulticastPrefixBits'];
- if (network['p5MulticastDepth'])
- netconf.data[ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_DEPTH] = network['p5MulticastDepth'];
+ if (network['multicastLimit'])
+ netconf.data[ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_LIMIT] = network['multicastLimit'];
if (network['multicastRates']) {
var ratesD = new Dictionary();
var ratesJ = JSON.parse(network['multicastRates']);
diff --git a/netconf-service/redis-schema.md b/netconf-service/redis-schema.md
index 4a1dff9a..e950f9e7 100644
--- a/netconf-service/redis-schema.md
+++ b/netconf-service/redis-schema.md
@@ -70,9 +70,7 @@ Each network has a network record indexed by its 64-bit network ID in lower-case
- M v6AssignMode :: 'none' (or null/empty/etc.), 'zt', 'v6native', 'dhcp6'
- M v6AssignPool :: network/bits from which to assign IPs
- M allowPassiveBridging :: if true, allow passive bridging
-- M multicastAlgorithm :: currently only 'p5' is valid, or empty/missing for default
-- M p5MulticastPrefixBits :: P5 multicast algorithm: prefix bits, 1-8 or 0 for default
-- M p5MulticastDepth :: P5 multicast algorithm: depth (TTL) in or 0 for default
+- M multicastLimit :: maximum number of recipients to receive a multicast on this network
- M multicastRates :: packed JSON containing multicast rates (see below)
- M subscriptions :: comma-delimited list of subscriptions for this network
- M ui :: arbitrary field that can be used by the UI to store stuff
diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp
index 1846fdcb..68771daa 100644
--- a/node/IncomingPacket.cpp
+++ b/node/IncomingPacket.cpp
@@ -610,11 +610,14 @@ bool IncomingPacket::_doP5_MULTICAST_FRAME(const RuntimeEnvironment *RR,const Sh
setSource(RR->identity.address());
compress();
+ unsigned int count = 0;
for(std::vector<Address>::iterator lp(legacyPeers.begin());lp!=legacyPeers.end();++lp) {
if ((*lp != origin)&&(*lp != source())) {
newInitializationVector();
setDestination(*lp);
RR->sw->send(*this,true);
+ if (++count >= 128) // harded-coded sanity limit for these legacy nodes
+ break;
}
}