summaryrefslogtreecommitdiff
path: root/node/Network.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2014-08-21 17:49:05 -0700
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2014-08-21 17:49:05 -0700
commitde4e29288d30183ca78a5e0878431ed47fa58b8f (patch)
tree5b944e4176ead99473b2457386de315aa87aa405 /node/Network.hpp
parent44d58ee871c498646213c01d1cd0417c2d537056 (diff)
downloadinfinitytier-de4e29288d30183ca78a5e0878431ed47fa58b8f.tar.gz
infinitytier-de4e29288d30183ca78a5e0878431ed47fa58b8f.zip
Fix for crazy Windows threading bug... repeatedly adding and removing a network now doesn't leave networks in limbo.
Diffstat (limited to 'node/Network.hpp')
-rw-r--r--node/Network.hpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/node/Network.hpp b/node/Network.hpp
index 1d62bdf1..cab41411 100644
--- a/node/Network.hpp
+++ b/node/Network.hpp
@@ -99,11 +99,6 @@ private:
*/
static SharedPtr<Network> newInstance(const RuntimeEnvironment *renv,NodeConfig *nc,uint64_t id);
- /**
- * Causes all persistent disk presence to be erased on delete, and this network won't be reloaded on next startup
- */
- inline void destroyOnDelete() throw() { _destroyOnDelete = true; }
-
public:
/**
* Broadcast multicast group: ff:ff:ff:ff:ff:ff / 0
@@ -419,6 +414,15 @@ public:
*/
void setEnabled(bool enabled);
+ /**
+ * Destroy this network
+ *
+ * This causes the network to disable itself, destroy its tap device, and on
+ * delete to delete all trace of itself on disk and remove any persistent tap
+ * device instances. Call this when a network is being removed from the system.
+ */
+ void destroy();
+
private:
static void _CBhandleTapData(void *arg,const MAC &from,const MAC &to,unsigned int etherType,const Buffer<4096> &data);
@@ -453,7 +457,7 @@ private:
SharedPtr<NetworkConfig> _config;
volatile uint64_t _lastConfigUpdate;
- volatile bool _destroyOnDelete;
+ volatile bool _destroyed;
volatile enum {
NETCONF_FAILURE_NONE,