summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-30 16:31:22 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-09-30 16:31:22 -0400
commite72a1de0d5bc11fae2d4182921a6fbe939e7f90b (patch)
treeb39a50690ef6f4875f92239a76d7c01fa7124d39
parent20832a056241d8e84029a6de4214f058fde3ce3b (diff)
downloadinfinitytier-e72a1de0d5bc11fae2d4182921a6fbe939e7f90b.tar.gz
infinitytier-e72a1de0d5bc11fae2d4182921a6fbe939e7f90b.zip
Fix bug in next hop selection.
-rw-r--r--node/PacketDecoder.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp
index 3ca2e40f..8bdddbe9 100644
--- a/node/PacketDecoder.cpp
+++ b/node/PacketDecoder.cpp
@@ -576,8 +576,11 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared
// First element in newFifo[] is next hop
Address nextHop(newFifo,ZT_ADDRESS_LENGTH);
- if (!nextHop)
- nextHop = _r->topology->getBestSupernode(&origin,1,true); // exclude origin in case it's itself a supernode
+ if (!nextHop) {
+ SharedPtr<Peer> supernode(_r->topology->getBestSupernode(&origin,1,true));
+ if (supernode)
+ nextHop = supernode->address();
+ }
if ((!nextHop)||(nextHop == _r->identity.address())) { // check against our addr is a sanity check
TRACE("not forwarding MULTICAST_FRAME from %s(%s): no next hop",source().toString().c_str(),_remoteAddress.toString().c_str());
return true;