diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-01-30 14:23:52 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-01-30 14:23:52 -0800 |
| commit | 490e86dde3532b36617548bdf9d952caa43dffa3 (patch) | |
| tree | a99d2a2d3b7179054f98b27db47bb1108e55b7ce /node/PacketDecoder.cpp | |
| parent | 6e076e77d82ef78d407fab66b235fe936c02d13a (diff) | |
| download | infinitytier-490e86dde3532b36617548bdf9d952caa43dffa3.tar.gz infinitytier-490e86dde3532b36617548bdf9d952caa43dffa3.zip | |
Bunch of fixes to startup, pinging, and choice of route. Also some TRACE updates.
Diffstat (limited to 'node/PacketDecoder.cpp')
| -rw-r--r-- | node/PacketDecoder.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp index 919b537e..25ec85ce 100644 --- a/node/PacketDecoder.cpp +++ b/node/PacketDecoder.cpp @@ -51,7 +51,7 @@ bool PacketDecoder::tryDecode(const RuntimeEnvironment *_r) // Unencrypted HELLOs are handled here since they are used to // populate our identity cache in the first place. _doHELLO() is special // in that it contains its own authentication logic. - TRACE("HELLO from %s(%s)",source().toString().c_str(),_remoteAddress.toString().c_str()); + TRACE("<< HELLO from %s(%s) (normal unencrypted HELLO)",source().toString().c_str(),_remoteAddress.toString().c_str()); return _doHELLO(_r); } @@ -78,9 +78,10 @@ bool PacketDecoder::tryDecode(const RuntimeEnvironment *_r) return true; } + TRACE("<< %s from %s(%s)",Packet::verbString(verb()),source().toString().c_str(),_remoteAddress.toString().c_str()); + switch(verb()) { case Packet::VERB_NOP: - TRACE("NOP from %s(%s)",source().toString().c_str(),_remoteAddress.toString().c_str()); peer->onReceive(_r,_localPort,_remoteAddress,hops(),packetId(),Packet::VERB_NOP,0,Packet::VERB_NOP,Utils::now()); return true; case Packet::VERB_HELLO: @@ -107,11 +108,7 @@ bool PacketDecoder::tryDecode(const RuntimeEnvironment *_r) return _doNETWORK_CONFIG_REQUEST(_r,peer); case Packet::VERB_NETWORK_CONFIG_REFRESH: return _doNETWORK_CONFIG_REFRESH(_r,peer); - default: - // This might be something from a new or old version of the protocol. - // Technically it passed MAC so the packet is still valid, but we - // ignore it. - TRACE("ignored unrecognized verb %.2x from %s(%s)",(unsigned int)verb(),source().toString().c_str(),_remoteAddress.toString().c_str()); + default: // ignore unknown verbs return true; } } else { |
