From b9dba97fdb8644e3c427b079d81ed9db3697bf1b Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 26 Apr 2016 17:11:25 -0700 Subject: Bunch more refactoring for an even more compact NetworkConfig representation, especially rules. --- node/Topology.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'node/Topology.cpp') diff --git a/node/Topology.cpp b/node/Topology.cpp index 21ed78a7..4105eae9 100644 --- a/node/Topology.cpp +++ b/node/Topology.cpp @@ -284,11 +284,8 @@ bool Topology::isUpstream(const Identity &id) const return true; std::vector< SharedPtr > nws(RR->node->allNetworks()); for(std::vector< SharedPtr >::const_iterator nw(nws.begin());nw!=nws.end();++nw) { - if ((*nw)->hasConfig()) { - for(unsigned int r=0;r<(*nw)->config().staticDeviceCount();++r) { - if ((((*nw)->config().staticDevice(r).flags & ZT_NETWORK_STATIC_DEVICE_IS_RELAY) != 0)&&((*nw)->config().staticDevice(r).address == id.address().toInt())) - return true; - } + if ((*nw)->config().isRelay(id.address())) { + return true; } } return false; -- cgit v1.2.3