diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-27 13:49:43 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-27 13:49:43 -0700 |
commit | 9f550292fe0ebc32e61eeada9e3a69970c874724 (patch) | |
tree | 94c804b06a9a44e79b6e09373f38a9562cb60bc6 /node/Node.hpp | |
parent | 5ba7ca91c03fc3ad9ac5c360e6156b91a208fb25 (diff) | |
download | infinitytier-9f550292fe0ebc32e61eeada9e3a69970c874724.tar.gz infinitytier-9f550292fe0ebc32e61eeada9e3a69970c874724.zip |
Simply network auth logic and always sent error on auth failure even for unknown networks to prevent forensics.
Diffstat (limited to 'node/Node.hpp')
-rw-r--r-- | node/Node.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/node/Node.hpp b/node/Node.hpp index 11462531..ddc52651 100644 --- a/node/Node.hpp +++ b/node/Node.hpp @@ -267,17 +267,19 @@ public: } /** - * Check whether a given packet ID is something we are expecting a reply to + * Check whether a given packet ID is something we are expecting a reply to (and erase from list) * * @param packetId Packet ID to check * @return True if we're expecting a reply */ - inline bool expectingReplyTo(const uint64_t packetId) const + inline bool expectingReplyTo(const uint64_t packetId) { const unsigned long bucket = (unsigned long)(packetId & ZT_EXPECTING_REPLIES_BUCKET_MASK1); for(unsigned long i=0;i<=ZT_EXPECTING_REPLIES_BUCKET_MASK2;++i) { - if (_expectingRepliesTo[bucket][i] == packetId) + if (_expectingRepliesTo[bucket][i] == packetId) { + _expectingRepliesTo[bucket][i] = 0; return true; + } } return false; } |