From 50d4f66d733fb703208bb922ba08f06854d8dde5 Mon Sep 17 00:00:00 2001 From: Kees Bos Date: Fri, 19 Jun 2015 21:19:42 +0200 Subject: Fixed member authorization bug and minor cleanup --- controller/SqliteNetworkController.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'controller/SqliteNetworkController.hpp') diff --git a/controller/SqliteNetworkController.hpp b/controller/SqliteNetworkController.hpp index d258933d..be2ca694 100644 --- a/controller/SqliteNetworkController.hpp +++ b/controller/SqliteNetworkController.hpp @@ -122,6 +122,8 @@ private: sqlite3_stmt *_sDeleteIpAssignmentPoolsForNetwork; sqlite3_stmt *_sDeleteRulesForNetwork; sqlite3_stmt *_sCreateIpAssignmentPool; + sqlite3_stmt *_sUpdateMemberAuthorized; + sqlite3_stmt *_sUpdateMemberActiveBridge; sqlite3_stmt *_sDeleteMember; sqlite3_stmt *_sDeleteNetwork; sqlite3_stmt *_sGetGateways; -- cgit v1.2.3 From 57c7992c785ab2f69fb2ddffd6f48bfebd96cab8 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 26 Jun 2015 12:36:45 -0700 Subject: GitHub issue #191 - kill intra-network multicast rate limits (which were not well supported or easily configurable anyway) -- this is really left over from the old collaborative multicast propagation algorithm. New algorithm (in for a while) has been sender-side replication in which sender "pays" all bandwidth, which intrinsically limits multicast. --- attic/BandwidthAccount.hpp | 153 +++++++++++++++++++++++++++++++++ controller/SqliteNetworkController.cpp | 26 +----- controller/SqliteNetworkController.hpp | 1 - controller/schema.sql | 11 --- controller/schema.sql.c | 11 --- node/BandwidthAccount.hpp | 153 --------------------------------- node/Network.cpp | 14 --- node/Network.hpp | 11 --- node/NetworkConfig.cpp | 31 ------- node/NetworkConfig.hpp | 33 ------- node/Switch.cpp | 6 -- 11 files changed, 157 insertions(+), 293 deletions(-) create mode 100644 attic/BandwidthAccount.hpp delete mode 100644 node/BandwidthAccount.hpp (limited to 'controller/SqliteNetworkController.hpp') diff --git a/attic/BandwidthAccount.hpp b/attic/BandwidthAccount.hpp new file mode 100644 index 00000000..3a6432c4 --- /dev/null +++ b/attic/BandwidthAccount.hpp @@ -0,0 +1,153 @@ +/* + * ZeroTier One - Network Virtualization Everywhere + * Copyright (C) 2011-2015 ZeroTier, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * -- + * + * ZeroTier may be used and distributed under the terms of the GPLv3, which + * are available at: http://www.gnu.org/licenses/gpl-3.0.html + * + * If you would like to embed ZeroTier into a commercial application or + * redistribute it in a modified binary form, please contact ZeroTier Networks + * LLC. Start here: http://www.zerotier.com/ + */ + +#ifndef ZT_BWACCOUNT_HPP +#define ZT_BWACCOUNT_HPP + +#include "Constants.hpp" + +#include + +#include +#include + +#include "Utils.hpp" + +#ifdef __WINDOWS__ +#define round(x) ((x-floor(x))>0.5 ? ceil(x) : floor(x)) +#endif + +namespace ZeroTier { + +/** + * Bandwidth account used for rate limiting multicast groups + * + * This is used to apply a bank account model to multicast groups. Each + * multicast packet counts against a balance, which accrues at a given + * rate in bytes per second. Debt is possible. These parameters are + * configurable. + * + * A bank account model permits bursting behavior, which correctly models + * how OSes and apps typically use multicast. It's common for things to + * spew lots of multicast messages at once, wait a while, then do it + * again. A consistent bandwidth limit model doesn't fit. + */ +class BandwidthAccount +{ +public: + /** + * Create an uninitialized account + * + * init() must be called before this is used. + */ + BandwidthAccount() throw() {} + + /** + * Create and initialize + * + * @param preload Initial balance to place in account + * @param maxb Maximum allowed balance (> 0) + * @param acc Rate of accrual in bytes per second + * @param now Current time + */ + BandwidthAccount(uint32_t preload,uint32_t maxb,uint32_t acc,uint64_t now) + throw() + { + init(preload,maxb,acc,now); + } + + /** + * Initialize or re-initialize account + * + * @param preload Initial balance to place in account + * @param maxb Maximum allowed balance (> 0) + * @param acc Rate of accrual in bytes per second + * @param now Current time + */ + inline void init(uint32_t preload,uint32_t maxb,uint32_t acc,uint64_t now) + throw() + { + _lastTime = ((double)now / 1000.0); + _balance = preload; + _maxBalance = maxb; + _accrual = acc; + } + + /** + * Update and retrieve balance of this account + * + * @param now Current time + * @return New balance updated from current clock + */ + inline uint32_t update(uint64_t now) + throw() + { + double lt = _lastTime; + double nowf = ((double)now / 1000.0); + _lastTime = nowf; + return (_balance = std::min(_maxBalance,(uint32_t)round((double)_balance + ((double)_accrual * (nowf - lt))))); + } + + /** + * Update balance and conditionally deduct + * + * If the deduction amount fits, it is deducted after update. Otherwise + * balance is updated and false is returned. + * + * @param amt Amount to deduct + * @param now Current time + * @return True if amount fit within balance and was deducted + */ + inline bool deduct(uint32_t amt,uint64_t now) + throw() + { + if (update(now) >= amt) { + _balance -= amt; + return true; + } + return false; + } + + /** + * @return Most recent balance without update + */ + inline uint32_t balance() const + throw() + { + return _balance; + } + +private: + double _lastTime; + uint32_t _balance; + uint32_t _maxBalance; + uint32_t _accrual; +}; + +} // namespace ZeroTier + +#endif diff --git a/controller/SqliteNetworkController.cpp b/controller/SqliteNetworkController.cpp index a1827a72..d77e06d8 100644 --- a/controller/SqliteNetworkController.cpp +++ b/controller/SqliteNetworkController.cpp @@ -155,7 +155,6 @@ SqliteNetworkController::SqliteNetworkController(const char *dbPath) : ||(sqlite3_prepare_v2(_db,"UPDATE Node SET lastAt = ?,lastSeen = ? WHERE id = ?",-1,&_sUpdateNode,(const char **)0) != SQLITE_OK) ||(sqlite3_prepare_v2(_db,"UPDATE Node SET lastSeen = ? WHERE id = ?",-1,&_sUpdateNode2,(const char **)0) != SQLITE_OK) ||(sqlite3_prepare_v2(_db,"SELECT etherType FROM Rule WHERE networkId = ? AND \"action\" = 'accept'",-1,&_sGetEtherTypesFromRuleTable,(const char **)0) != SQLITE_OK) - ||(sqlite3_prepare_v2(_db,"SELECT mgMac,mgAdi,preload,maxBalance,accrual FROM MulticastRate WHERE networkId = ?",-1,&_sGetMulticastRates,(const char **)0) != SQLITE_OK) ||(sqlite3_prepare_v2(_db,"SELECT nodeId FROM Member WHERE networkId = ? AND activeBridge > 0 AND authorized > 0",-1,&_sGetActiveBridges,(const char **)0) != SQLITE_OK) ||(sqlite3_prepare_v2(_db,"SELECT ip,ipNetmaskBits FROM IpAssignment WHERE networkId = ? AND nodeId = ? AND ipVersion = ?",-1,&_sGetIpAssignmentsForNode,(const char **)0) != SQLITE_OK) ||(sqlite3_prepare_v2(_db,"SELECT ipNetwork,ipNetmaskBits FROM IpAssignmentPool WHERE networkId = ? AND ipVersion = ?",-1,&_sGetIpAssignmentPools,(const char **)0) != SQLITE_OK) @@ -204,7 +203,6 @@ SqliteNetworkController::~SqliteNetworkController() sqlite3_finalize(_sUpdateNode); sqlite3_finalize(_sUpdateNode2); sqlite3_finalize(_sGetEtherTypesFromRuleTable); - sqlite3_finalize(_sGetMulticastRates); sqlite3_finalize(_sGetActiveBridges); sqlite3_finalize(_sGetIpAssignmentsForNode); sqlite3_finalize(_sGetIpAssignmentPools); @@ -403,26 +401,10 @@ NetworkController::ResultCode SqliteNetworkController::doNetworkConfigRequest(co netconf[ZT_NETWORKCONFIG_DICT_KEY_ALLOWED_ETHERNET_TYPES] = allowedEtherTypesCsv; } - { - std::string multicastRates; - sqlite3_reset(_sGetMulticastRates); - sqlite3_bind_text(_sGetMulticastRates,1,network.id,16,SQLITE_STATIC); - while (sqlite3_step(_sGetMulticastRates) == SQLITE_ROW) { - const char *mac = (const char *)sqlite3_column_text(_sGetMulticastRates,0); - if ((mac)&&(strlen(mac) == 12)) { - unsigned long adi = ((unsigned long)sqlite3_column_int64(_sGetMulticastRates,1)) & 0xffffffff; - char tmp[256]; - Utils::snprintf(tmp,sizeof(tmp),"%s/%.4lx=%x,%x,%x\n",mac,adi,sqlite3_column_int(_sGetMulticastRates,2),sqlite3_column_int(_sGetMulticastRates,3),sqlite3_column_int(_sGetMulticastRates,4)); - multicastRates.append(tmp); - } - } - if (multicastRates.length() > 0) - netconf[ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_RATES] = multicastRates; - if (network.multicastLimit > 0) { - char ml[16]; - Utils::snprintf(ml,sizeof(ml),"%lx",(unsigned long)network.multicastLimit); - netconf[ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_LIMIT] = ml; - } + if (network.multicastLimit > 0) { + char ml[16]; + Utils::snprintf(ml,sizeof(ml),"%lx",(unsigned long)network.multicastLimit); + netconf[ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_LIMIT] = ml; } { diff --git a/controller/SqliteNetworkController.hpp b/controller/SqliteNetworkController.hpp index be2ca694..9cdbc404 100644 --- a/controller/SqliteNetworkController.hpp +++ b/controller/SqliteNetworkController.hpp @@ -99,7 +99,6 @@ private: sqlite3_stmt *_sUpdateNode; sqlite3_stmt *_sUpdateNode2; sqlite3_stmt *_sGetEtherTypesFromRuleTable; - sqlite3_stmt *_sGetMulticastRates; sqlite3_stmt *_sGetActiveBridges; sqlite3_stmt *_sGetIpAssignmentsForNode; sqlite3_stmt *_sGetIpAssignmentPools; diff --git a/controller/schema.sql b/controller/schema.sql index 809c7161..d2261b2a 100644 --- a/controller/schema.sql +++ b/controller/schema.sql @@ -64,17 +64,6 @@ CREATE TABLE Member ( CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge); -CREATE TABLE MulticastRate ( - networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE, - mgMac char(12) NOT NULL, - mgAdi integer NOT NULL DEFAULT(0), - preload integer NOT NULL, - maxBalance integer NOT NULL, - accrual integer NOT NULL -); - -CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId); - CREATE TABLE Relay ( networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE, nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE, diff --git a/controller/schema.sql.c b/controller/schema.sql.c index f1c66358..1157facc 100644 --- a/controller/schema.sql.c +++ b/controller/schema.sql.c @@ -65,17 +65,6 @@ "\n"\ "CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge);\n"\ "\n"\ -"CREATE TABLE MulticastRate (\n"\ -" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\ -" mgMac char(12) NOT NULL,\n"\ -" mgAdi integer NOT NULL DEFAULT(0),\n"\ -" preload integer NOT NULL,\n"\ -" maxBalance integer NOT NULL,\n"\ -" accrual integer NOT NULL\n"\ -");\n"\ -"\n"\ -"CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId);\n"\ -"\n"\ "CREATE TABLE Relay (\n"\ " networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\ " nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,\n"\ diff --git a/node/BandwidthAccount.hpp b/node/BandwidthAccount.hpp deleted file mode 100644 index 3a6432c4..00000000 --- a/node/BandwidthAccount.hpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * ZeroTier One - Network Virtualization Everywhere - * Copyright (C) 2011-2015 ZeroTier, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * -- - * - * ZeroTier may be used and distributed under the terms of the GPLv3, which - * are available at: http://www.gnu.org/licenses/gpl-3.0.html - * - * If you would like to embed ZeroTier into a commercial application or - * redistribute it in a modified binary form, please contact ZeroTier Networks - * LLC. Start here: http://www.zerotier.com/ - */ - -#ifndef ZT_BWACCOUNT_HPP -#define ZT_BWACCOUNT_HPP - -#include "Constants.hpp" - -#include - -#include -#include - -#include "Utils.hpp" - -#ifdef __WINDOWS__ -#define round(x) ((x-floor(x))>0.5 ? ceil(x) : floor(x)) -#endif - -namespace ZeroTier { - -/** - * Bandwidth account used for rate limiting multicast groups - * - * This is used to apply a bank account model to multicast groups. Each - * multicast packet counts against a balance, which accrues at a given - * rate in bytes per second. Debt is possible. These parameters are - * configurable. - * - * A bank account model permits bursting behavior, which correctly models - * how OSes and apps typically use multicast. It's common for things to - * spew lots of multicast messages at once, wait a while, then do it - * again. A consistent bandwidth limit model doesn't fit. - */ -class BandwidthAccount -{ -public: - /** - * Create an uninitialized account - * - * init() must be called before this is used. - */ - BandwidthAccount() throw() {} - - /** - * Create and initialize - * - * @param preload Initial balance to place in account - * @param maxb Maximum allowed balance (> 0) - * @param acc Rate of accrual in bytes per second - * @param now Current time - */ - BandwidthAccount(uint32_t preload,uint32_t maxb,uint32_t acc,uint64_t now) - throw() - { - init(preload,maxb,acc,now); - } - - /** - * Initialize or re-initialize account - * - * @param preload Initial balance to place in account - * @param maxb Maximum allowed balance (> 0) - * @param acc Rate of accrual in bytes per second - * @param now Current time - */ - inline void init(uint32_t preload,uint32_t maxb,uint32_t acc,uint64_t now) - throw() - { - _lastTime = ((double)now / 1000.0); - _balance = preload; - _maxBalance = maxb; - _accrual = acc; - } - - /** - * Update and retrieve balance of this account - * - * @param now Current time - * @return New balance updated from current clock - */ - inline uint32_t update(uint64_t now) - throw() - { - double lt = _lastTime; - double nowf = ((double)now / 1000.0); - _lastTime = nowf; - return (_balance = std::min(_maxBalance,(uint32_t)round((double)_balance + ((double)_accrual * (nowf - lt))))); - } - - /** - * Update balance and conditionally deduct - * - * If the deduction amount fits, it is deducted after update. Otherwise - * balance is updated and false is returned. - * - * @param amt Amount to deduct - * @param now Current time - * @return True if amount fit within balance and was deducted - */ - inline bool deduct(uint32_t amt,uint64_t now) - throw() - { - if (update(now) >= amt) { - _balance -= amt; - return true; - } - return false; - } - - /** - * @return Most recent balance without update - */ - inline uint32_t balance() const - throw() - { - return _balance; - } - -private: - double _lastTime; - uint32_t _balance; - uint32_t _maxBalance; - uint32_t _accrual; -}; - -} // namespace ZeroTier - -#endif diff --git a/node/Network.cpp b/node/Network.cpp index a217595a..d5dc7d58 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -357,20 +357,6 @@ void Network::clean() } } -bool Network::updateAndCheckMulticastBalance(const MulticastGroup &mg,unsigned int bytes) -{ - const uint64_t now = RR->node->now(); - Mutex::Lock _l(_lock); - if (!_config) - return false; - std::map< MulticastGroup,BandwidthAccount >::iterator bal(_multicastRateAccounts.find(mg)); - if (bal == _multicastRateAccounts.end()) { - NetworkConfig::MulticastRate r(_config->multicastRate(mg)); - bal = _multicastRateAccounts.insert(std::pair< MulticastGroup,BandwidthAccount >(mg,BandwidthAccount(r.preload,r.maxBalance,r.accrual,now))).first; - } - return bal->second.deduct(bytes,now); -} - void Network::learnBridgeRoute(const MAC &mac,const Address &addr) { Mutex::Lock _l(_lock); diff --git a/node/Network.hpp b/node/Network.hpp index 7976d901..daa4554e 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -47,7 +47,6 @@ #include "MulticastGroup.hpp" #include "MAC.hpp" #include "Dictionary.hpp" -#include "BandwidthAccount.hpp" #include "Multicaster.hpp" #include "NetworkConfig.hpp" #include "CertificateOfMembership.hpp" @@ -237,15 +236,6 @@ public: _externalConfig(ec); } - /** - * Update and check multicast rate balance for a multicast group - * - * @param mg Multicast group - * @param bytes Size of packet - * @return True if packet is within budget - */ - bool updateAndCheckMulticastBalance(const MulticastGroup &mg,unsigned int bytes); - /** * Get current network config or throw exception * @@ -370,7 +360,6 @@ private: std::vector< MulticastGroup > _myMulticastGroups; // multicast groups that we belong to including those behind us (updated periodically) std::map< MulticastGroup,uint64_t > _multicastGroupsBehindMe; // multicast groups bridged to us and when we last saw activity on each - std::map< MulticastGroup,BandwidthAccount > _multicastRateAccounts; std::map _remoteBridgeRoutes; // remote addresses where given MACs are reachable diff --git a/node/NetworkConfig.cpp b/node/NetworkConfig.cpp index 5ed1dd3f..8d682947 100644 --- a/node/NetworkConfig.cpp +++ b/node/NetworkConfig.cpp @@ -32,10 +32,6 @@ namespace ZeroTier { -// This is fast enough for things like Apple's mDNS spam, so it should serve -// as a good default for your average network. -const NetworkConfig::MulticastRate NetworkConfig::DEFAULT_MULTICAST_RATE(40000,60000,80); - SharedPtr NetworkConfig::createTestNetworkConfig(const Address &self) { SharedPtr nc(new NetworkConfig()); @@ -85,18 +81,6 @@ std::vector NetworkConfig::allowedEtherTypes() const return ets; } -const NetworkConfig::MulticastRate &NetworkConfig::multicastRate(const MulticastGroup &mg) const - throw() -{ - std::map::const_iterator r(_multicastRates.find(mg)); - if (r == _multicastRates.end()) { - r = _multicastRates.find(MulticastGroup()); // zero MG signifies network's default rate - if (r == _multicastRates.end()) - return DEFAULT_MULTICAST_RATE; // neither specific nor default found in network config - } - return r->second; -} - void NetworkConfig::_fromDictionary(const Dictionary &d) { static const std::string zero("0"); @@ -181,13 +165,6 @@ void NetworkConfig::_fromDictionary(const Dictionary &d) std::sort(_activeBridges.begin(),_activeBridges.end()); std::unique(_activeBridges.begin(),_activeBridges.end()); - Dictionary multicastRateEntries(d.get(ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_RATES,std::string())); - for(Dictionary::const_iterator i(multicastRateEntries.begin());i!=multicastRateEntries.end();++i) { - std::vector params(Utils::split(i->second.c_str(),",","","")); - if (params.size() >= 3) - _multicastRates[MulticastGroup(i->first)] = MulticastRate(Utils::hexStrToUInt(params[0].c_str()),Utils::hexStrToUInt(params[1].c_str()),Utils::hexStrToUInt(params[2].c_str())); - } - std::vector relaysSplit(Utils::split(d.get(ZT_NETWORKCONFIG_DICT_KEY_RELAYS,"").c_str(),",","","")); for(std::vector::const_iterator r(relaysSplit.begin());r!=relaysSplit.end();++r) { std::size_t semi(r->find(';')); // address;ip/port,... @@ -221,14 +198,6 @@ bool NetworkConfig::operator==(const NetworkConfig &nc) const if (_gateways != nc._gateways) return false; if (_activeBridges != nc._activeBridges) return false; if (_relays != nc._relays) return false; - if (_multicastRates.size() == nc._multicastRates.size()) { - // uclibc++ doesn't seem to implement map<> != map<> correctly, so do - // it ourselves. Note that this depends on the maps being sorted. - for(std::map::const_iterator a(_multicastRates.begin()),b(nc._multicastRates.begin());a!=_multicastRates.end();++a,++b) { - if ((a->first != b->first)||(a->second != b->second)) - return false; - } - } else return false; if (_com != nc._com) return false; return true; } diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp index 2fb56d6a..75395fd5 100644 --- a/node/NetworkConfig.hpp +++ b/node/NetworkConfig.hpp @@ -68,9 +68,6 @@ namespace ZeroTier { // integer(hex) #define ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_LIMIT "ml" -// dictionary of one or more of: MAC/ADI=preload,maxbalance,accrual -#define ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_RATES "mr" - // 0/1 #define ZT_NETWORKCONFIG_DICT_KEY_PRIVATE "p" @@ -114,27 +111,6 @@ class NetworkConfig friend class SharedPtr; public: - /** - * Tuple of multicast rate parameters - */ - struct MulticastRate - { - MulticastRate() throw() {} - MulticastRate(uint32_t pl,uint32_t maxb,uint32_t acc) throw() : preload(pl),maxBalance(maxb),accrual(acc) {} - - uint32_t preload; - uint32_t maxBalance; - uint32_t accrual; - - inline bool operator==(const MulticastRate &mr) const { return ((preload == mr.preload)&&(maxBalance == mr.maxBalance)&&(accrual == mr.accrual)); } - inline bool operator!=(const MulticastRate &mr) const { return (!(*this == mr)); } - }; - - /** - * A hard-coded default multicast rate for networks that don't specify - */ - static const MulticastRate DEFAULT_MULTICAST_RATE; - /** * Create an instance of a NetworkConfig for the test network ID * @@ -176,7 +152,6 @@ public: inline uint64_t revision() const throw() { return _revision; } inline const Address &issuedTo() const throw() { return _issuedTo; } inline unsigned int multicastLimit() const throw() { return _multicastLimit; } - inline const std::map &multicastRates() const throw() { return _multicastRates; } inline bool allowPassiveBridging() const throw() { return _allowPassiveBridging; } inline bool isPublic() const throw() { return (!_private); } inline bool isPrivate() const throw() { return _private; } @@ -198,13 +173,6 @@ public: return ( (_allowPassiveBridging) || (std::find(_activeBridges.begin(),_activeBridges.end(),fromPeer) != _activeBridges.end()) ); } - /** - * @param mg Multicast group - * @return Multicast rate or DEFAULT_MULTICAST_RATE if not set - */ - const MulticastRate &multicastRate(const MulticastGroup &mg) const - throw(); - bool operator==(const NetworkConfig &nc) const; inline bool operator!=(const NetworkConfig &nc) const { return (!(*this == nc)); } @@ -229,7 +197,6 @@ private: std::vector _gateways; std::vector
_activeBridges; std::vector< std::pair > _relays; - std::map _multicastRates; CertificateOfMembership _com; AtomicCounter __refCount; diff --git a/node/Switch.cpp b/node/Switch.cpp index af80f5e8..236c1e66 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -145,12 +145,6 @@ void Switch::onLocalEthernet(const SharedPtr &network,const MAC &from,c if (fromBridged) network->learnBridgedMulticastGroup(mg,RR->node->now()); - // Check multicast/broadcast bandwidth quotas and reject if quota exceeded - if (!network->updateAndCheckMulticastBalance(mg,len)) { - TRACE("%.16llx: didn't multicast %u bytes, quota exceeded for multicast group %s",network->id(),len,mg.toString().c_str()); - return; - } - //TRACE("%.16llx: MULTICAST %s -> %s %s %u",network->id(),from.toString().c_str(),mg.toString().c_str(),etherTypeName(etherType),len); RR->mc->send( -- cgit v1.2.3