From 49d31613b91cf578d289086c28ea88c202c617d2 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 14 Apr 2015 15:16:04 -0700 Subject: [PATCH] Fix some minor issues, now to reintegrate taps. --- node/Network.cpp | 6 ++---- node/NetworkConfig.hpp | 1 + service/ControlPlane.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/node/Network.cpp b/node/Network.cpp index 26650ca42..2a071f6fb 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -96,8 +96,6 @@ Network::Network(const RuntimeEnvironment *renv,uint64_t nwid) : } catch ( ... ) {} // ignore invalid MCDB, we'll re-learn from peers } - requestConfiguration(); - ZT1_VirtualNetworkConfig ctmp; _externalConfig(&ctmp); _portError = RR->node->configureVirtualNetworkPort(_id,ZT1_VIRTUAL_NETWORK_CONFIG_OPERATION_UP,&ctmp); @@ -468,7 +466,7 @@ void Network::_externalConfig(ZT1_VirtualNetworkConfig *ec) const { // assumes _lock is locked ec->nwid = _id; - ec->mac = MAC(RR->identity.address(),_id); + ec->mac = _mac.toInt(); if (_config) Utils::scopy(ec->name,sizeof(ec->name),_config->name().c_str()); else ec->name[0] = (char)0; @@ -481,7 +479,7 @@ void Network::_externalConfig(ZT1_VirtualNetworkConfig *ec) const ec->portError = _portError; ec->netconfRevision = (_config) ? (unsigned long)_config->revision() : 0; - ec->multicastSubscriptionCount = std::max((unsigned int)_myMulticastGroups.size(),(unsigned int)ZT1_MAX_NETWORK_MULTICAST_SUBSCRIPTIONS); + ec->multicastSubscriptionCount = std::min((unsigned int)_myMulticastGroups.size(),(unsigned int)ZT1_MAX_NETWORK_MULTICAST_SUBSCRIPTIONS); for(unsigned int i=0;imulticastSubscriptionCount;++i) { ec->multicastSubscriptions[i].mac = _myMulticastGroups[i].mac().toInt(); ec->multicastSubscriptions[i].adi = _myMulticastGroups[i].adi(); diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp index 0aa7a70d4..31e47f41d 100644 --- a/node/NetworkConfig.hpp +++ b/node/NetworkConfig.hpp @@ -65,6 +65,7 @@ namespace ZeroTier { #define ZT_NETWORKCONFIG_DICT_KEY_ENABLE_BROADCAST "eb" #define ZT_NETWORKCONFIG_DICT_KEY_ALLOW_PASSIVE_BRIDGING "pb" #define ZT_NETWORKCONFIG_DICT_KEY_ACTIVE_BRIDGES "ab" +#define ZT_NETWORKCONFIG_DICT_KEY_RELAYS "rl" /** * Network configuration received from netconf master nodes diff --git a/service/ControlPlane.cpp b/service/ControlPlane.cpp index 5077dce94..01e31fbff 100644 --- a/service/ControlPlane.cpp +++ b/service/ControlPlane.cpp @@ -135,7 +135,7 @@ static void _jsonAppend(std::string &buf,const ZT1_VirtualNetworkConfig *nc) "{" "\"nwid\": \"%.16llx\"," "\"mac\": \"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\"," - "\"name\": %s," + "\"name\": \"%s\"," "\"status\": \"%s\"," "\"type\": \"%s\"," "\"mtu\": %u,"