diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-13 09:30:02 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-13 09:30:02 -0700 |
commit | 0b9524f23d96ad4752a2a2cace92bc1c0306b1b6 (patch) | |
tree | 5b9b8b3526f17254043263ac7b67b358e98bb6e8 | |
parent | 4bf3bcbd555025c5e76301ca49f74cafa526d902 (diff) | |
parent | 3f0eca72f7c52603f8d389c6cef3b98c7026c859 (diff) | |
download | infinitytier-0b9524f23d96ad4752a2a2cace92bc1c0306b1b6.tar.gz infinitytier-0b9524f23d96ad4752a2a2cace92bc1c0306b1b6.zip |
Merge branch 'adamierymenko-dev' of http://git.int.zerotier.com/zerotier/zerotierone into adamierymenko-dev
-rw-r--r-- | node/IncomingPacket.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp index deebac9b..afb07b9d 100644 --- a/node/IncomingPacket.cpp +++ b/node/IncomingPacket.cpp @@ -185,18 +185,17 @@ bool IncomingPacket::_doHELLO(const RuntimeEnvironment *RR) try { const unsigned int protoVersion = (*this)[ZT_PROTO_VERB_HELLO_IDX_PROTOCOL_VERSION]; - if (protoVersion < ZT_PROTO_VERSION_MIN) { - TRACE("dropped HELLO from %s(%s): protocol version too old",id.address().toString().c_str(),_remoteAddress.toString().c_str()); - return true; - } - const unsigned int vMajor = (*this)[ZT_PROTO_VERB_HELLO_IDX_MAJOR_VERSION]; const unsigned int vMinor = (*this)[ZT_PROTO_VERB_HELLO_IDX_MINOR_VERSION]; const unsigned int vRevision = at<uint16_t>(ZT_PROTO_VERB_HELLO_IDX_REVISION); const uint64_t timestamp = at<uint64_t>(ZT_PROTO_VERB_HELLO_IDX_TIMESTAMP); - Identity id; unsigned int destAddrPtr = id.deserialize(*this,ZT_PROTO_VERB_HELLO_IDX_IDENTITY) + ZT_PROTO_VERB_HELLO_IDX_IDENTITY; + + if (protoVersion < ZT_PROTO_VERSION_MIN) { + TRACE("dropped HELLO from %s(%s): protocol version too old",id.address().toString().c_str(),_remoteAddress.toString().c_str()); + return true; + } if (source() != id.address()) { TRACE("dropped HELLO from %s(%s): identity not for sending address",source().toString().c_str(),_remoteAddress.toString().c_str()); return true; |