summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/Constants.hpp9
-rw-r--r--node/Network.cpp8
-rw-r--r--node/Network.hpp2
3 files changed, 10 insertions, 9 deletions
diff --git a/node/Constants.hpp b/node/Constants.hpp
index 4baa1ae7..ed1153d5 100644
--- a/node/Constants.hpp
+++ b/node/Constants.hpp
@@ -155,11 +155,6 @@
#define ZT_IF_MTU ZT1_MAX_MTU
/**
- * Default interface metric for ZeroTier taps -- should be higher than physical ports
- */
-#define ZT_DEFAULT_IF_METRIC 32768
-
-/**
* Maximum number of packet fragments we'll support
*
* The actual spec allows 16, but this is the most we'll support right
@@ -313,14 +308,14 @@
#define ZT_ANTIRECURSION_HISTORY_SIZE 16
/**
- * How often to broadcast beacons over physical local LANs
+ * How often to send LAN beacons
*/
#define ZT_BEACON_INTERVAL 30000
/**
* Do not respond to any beacon more often than this
*/
-#define ZT_MIN_BEACON_RESPONSE_INTERVAL (ZT_BEACON_INTERVAL / 32)
+#define ZT_MIN_BEACON_RESPONSE_INTERVAL 2500
/**
* Sanity limit on maximum bridge routes
diff --git a/node/Network.cpp b/node/Network.cpp
index 0575f48c..ba0ee984 100644
--- a/node/Network.cpp
+++ b/node/Network.cpp
@@ -436,7 +436,12 @@ void Network::learnBridgedMulticastGroup(const MulticastGroup &mg,uint64_t now)
void Network::setEnabled(bool enabled)
{
Mutex::Lock _l(_lock);
- _enabled = enabled;
+ if (_enabled != enabled) {
+ _enabled = enabled;
+ ZT1_VirtualNetworkConfig ctmp;
+ _externalConfig(&ctmp);
+ _portError = RR->node->configureVirtualNetworkPort(_id,ZT1_VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE,&ctmp);
+ }
}
void Network::destroy()
@@ -478,6 +483,7 @@ void Network::_externalConfig(ZT1_VirtualNetworkConfig *ec) const
ec->bridge = (_config) ? ((_config->allowPassiveBridging() || (std::find(_config->activeBridges().begin(),_config->activeBridges().end(),RR->identity.address()) != _config->activeBridges().end())) ? 1 : 0) : 0;
ec->broadcastEnabled = (_config) ? (_config->enableBroadcast() ? 1 : 0) : 0;
ec->portError = _portError;
+ ec->enabled = (_enabled) ? 1 : 0;
ec->netconfRevision = (_config) ? (unsigned long)_config->revision() : 0;
ec->multicastSubscriptionCount = std::min((unsigned int)_myMulticastGroups.size(),(unsigned int)ZT1_MAX_NETWORK_MULTICAST_SUBSCRIPTIONS);
diff --git a/node/Network.hpp b/node/Network.hpp
index 6a41fa67..08d9e527 100644
--- a/node/Network.hpp
+++ b/node/Network.hpp
@@ -348,7 +348,7 @@ private:
const RuntimeEnvironment *RR;
uint64_t _id;
MAC _mac; // local MAC address
- volatile bool _enabled;
+ bool _enabled;
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