summaryrefslogtreecommitdiff
path: root/node/IncomingPacket.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-01-30 15:40:22 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-01-30 15:40:22 -0800
commiteebd271bb1e3ab0d25f48db07a1a3f1154215bc7 (patch)
treeaf7e706bd2fd9265441fea70ba6a74224913b634 /node/IncomingPacket.cpp
parentff74ec248263db8941429e3626738f57b558cbc3 (diff)
downloadinfinitytier-eebd271bb1e3ab0d25f48db07a1a3f1154215bc7.tar.gz
infinitytier-eebd271bb1e3ab0d25f48db07a1a3f1154215bc7.zip
Implement cross cluster sharing of network configs to make clusters able to actually join networks.
Diffstat (limited to 'node/IncomingPacket.cpp')
-rw-r--r--node/IncomingPacket.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp
index a3fbbefc..e703af59 100644
--- a/node/IncomingPacket.cpp
+++ b/node/IncomingPacket.cpp
@@ -461,8 +461,12 @@ bool IncomingPacket::_doOK(const RuntimeEnvironment *RR,const SharedPtr<Peer> &p
case Packet::VERB_NETWORK_CONFIG_REQUEST: {
const SharedPtr<Network> network(RR->node->network(at<uint64_t>(ZT_PROTO_VERB_OK_IDX_PAYLOAD)));
- if (network)
+ if (network) {
+#ifdef ZT_ENABLE_CLUSTER
+ RR->cluster->broadcastNetworkConfigChunk(field(ZT_PACKET_IDX_PAYLOAD,size() - ZT_PROTO_VERB_OK_IDX_PAYLOAD),size() - ZT_PROTO_VERB_OK_IDX_PAYLOAD);
+#endif
network->handleConfigChunk(*this,ZT_PROTO_VERB_OK_IDX_PAYLOAD);
+ }
} break;
case Packet::VERB_MULTICAST_GATHER: {
@@ -922,6 +926,9 @@ bool IncomingPacket::_doNETWORK_CONFIG(const RuntimeEnvironment *RR,const Shared
try {
const SharedPtr<Network> network(RR->node->network(at<uint64_t>(ZT_PACKET_IDX_PAYLOAD)));
if (network) {
+#ifdef ZT_ENABLE_CLUSTER
+ RR->cluster->broadcastNetworkConfigChunk(field(ZT_PACKET_IDX_PAYLOAD,size() - ZT_PACKET_IDX_PAYLOAD),size() - ZT_PACKET_IDX_PAYLOAD);
+#endif
const uint64_t configUpdateId = network->handleConfigChunk(*this,ZT_PACKET_IDX_PAYLOAD);
if (configUpdateId) {
Packet outp(peer->address(),RR->identity.address(),Packet::VERB_OK);