Fix some minor issues, now to reintegrate taps.

This commit is contained in:
Adam Ierymenko 2015-04-14 15:16:04 -07:00
parent 758b5caf94
commit 49d31613b9
3 changed files with 4 additions and 5 deletions

View File

@ -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;i<ec->multicastSubscriptionCount;++i) {
ec->multicastSubscriptions[i].mac = _myMulticastGroups[i].mac().toInt();
ec->multicastSubscriptions[i].adi = _myMulticastGroups[i].adi();

View File

@ -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

View File

@ -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,"