diff --git a/netconf-service/netconf-master.js b/netconf-service/netconf-master.js index f5c0d223a..fb32bc606 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 4a1dff9a7..e950f9e78 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 1846fdcb6..68771daa4 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
::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; } }