summaryrefslogtreecommitdiff
path: root/node/Switch.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-26 15:47:32 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-26 15:47:32 -0700
commitde761c5a82b7928decf94e93aff4af7adc309e7a (patch)
treedb16998b2e2a2cf83b9737ce345e361a8e3401d4 /node/Switch.cpp
parent6cf1da166f5bab0c306b8504541e70ba1fb4b1a3 (diff)
downloadinfinitytier-de761c5a82b7928decf94e93aff4af7adc309e7a.tar.gz
infinitytier-de761c5a82b7928decf94e93aff4af7adc309e7a.zip
Fix test world def.
Diffstat (limited to 'node/Switch.cpp')
-rw-r--r--node/Switch.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp
index 0edaa96d..709ed802 100644
--- a/node/Switch.cpp
+++ b/node/Switch.cpp
@@ -295,6 +295,8 @@ void Switch::send(const Packet &packet,bool encrypt,uint64_t nwid)
return;
}
+ //TRACE(">> %s to %s (%u bytes, encrypt==%d, nwid==%.16llx)",Packet::verbString(packet.verb()),packet.destination().toString().c_str(),packet.size(),(int)encrypt,nwid);
+
if (!_trySend(packet,encrypt,nwid)) {
Mutex::Lock _l(_txQueue_m);
_txQueue.push_back(TXQueueEntry(packet.destination(),RR->node->now(),packet,encrypt,nwid));
@@ -637,6 +639,11 @@ void Switch::_handleRemotePacketHead(const InetAddress &localAddr,const InetAddr
Address source(packet->source());
Address destination(packet->destination());
+ // Catch this and toss it -- it would never work, but it could happen if we somehow
+ // mistakenly guessed an address we're bound to as a destination for another peer.
+ if (source == RR->identity.address())
+ return;
+
//TRACE("<< %.16llx %s -> %s (size: %u)",(unsigned long long)packet->packetId(),source.toString().c_str(),destination.toString().c_str(),packet->size());
if (destination != RR->identity.address()) {