summaryrefslogtreecommitdiff
path: root/node/Network.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-06 01:28:56 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-06 01:28:56 -0400
commit28a73b620e60dd5d9c77aa7494d4c71da8b1d08c (patch)
tree5b708b71a3703afd52301a6e0fc1a4e192db6a73 /node/Network.hpp
parente73c4cb68b7461b8a2bdf7b6e5919bd0fcef2c1e (diff)
downloadinfinitytier-28a73b620e60dd5d9c77aa7494d4c71da8b1d08c.tar.gz
infinitytier-28a73b620e60dd5d9c77aa7494d4c71da8b1d08c.zip
Bunch more debugging and loop closing on new netconf.
Diffstat (limited to 'node/Network.hpp')
-rw-r--r--node/Network.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/node/Network.hpp b/node/Network.hpp
index 6b7b3055..d5c091e8 100644
--- a/node/Network.hpp
+++ b/node/Network.hpp
@@ -273,6 +273,22 @@ private:
~Network();
/**
+ * Called by NodeConfig after create
+ *
+ * This is called separately to avoid a rather evil race condition.
+ * If config is restored in the constructor, then it's possible that
+ * the tap will be assigned an IP and will start getting packets
+ * before SharedPtr<Network> has gotten the pointer from the initial
+ * object construct. That causes SharedPtr<Network> in the static
+ * method that handles tap traffic to delete the object, resulting
+ * in all sorts of utter madness. C++ is crazy like that.
+ *
+ * Actually the way we're using SharedPtr<Network> is hacky and
+ * ugly, so it's our fault sorta.
+ */
+ void restoreState();
+
+ /**
* Causes all persistent disk presence to be erased on delete
*/
inline void destroyOnDelete()