diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-10 11:57:45 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-10 11:57:45 -0800 |
commit | 12d32b9311d86a04353c8182e5d7cf4ec514d3df (patch) | |
tree | c4ed707a986e939f123f6906634e9159d551a3fd /node | |
parent | 226123ca08ffbb5f4e4f0699b92fb9db08576a66 (diff) | |
download | infinitytier-12d32b9311d86a04353c8182e5d7cf4ec514d3df.tar.gz infinitytier-12d32b9311d86a04353c8182e5d7cf4ec514d3df.zip |
Small fix to send pushes if not a reply.
Diffstat (limited to 'node')
-rw-r--r-- | node/Node.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/node/Node.cpp b/node/Node.cpp index 69808bcf..c05a1850 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -736,9 +736,11 @@ void Node::ncSendConfig(uint64_t nwid,uint64_t requestPacketId,const Address &de unsigned int chunkIndex = 0; while (chunkIndex < totalSize) { const unsigned int chunkLen = std::min(totalSize - chunkIndex,(unsigned int)(ZT_UDP_DEFAULT_PAYLOAD_MTU - (ZT_PACKET_IDX_PAYLOAD + 256))); - Packet outp(destination,RR->identity.address(),Packet::VERB_OK); - outp.append((unsigned char)Packet::VERB_NETWORK_CONFIG_REQUEST); - outp.append(requestPacketId); + Packet outp(destination,RR->identity.address(),(requestPacketId) ? Packet::VERB_OK : Packet::VERB_NETWORK_CONFIG); + if (requestPacketId) { + outp.append((unsigned char)Packet::VERB_NETWORK_CONFIG_REQUEST); + outp.append(requestPacketId); + } const unsigned int sigStart = outp.size(); outp.append(nwid); @@ -800,7 +802,7 @@ void Node::ncSendError(uint64_t nwid,uint64_t requestPacketId,const Address &des } outp.append(nwid); RR->sw->send(outp,true); - } + } // else we can't send an ERROR() in response to nothing, so discard } } // namespace ZeroTier |