summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-09 16:22:34 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-09 16:22:34 -0700
commiteff1fe3c61aee8029337971545da5251f470ac53 (patch)
tree5458da92e5e19efc200ee6654780a9c1c83e7ac3 /node
parent7d01fab1326e3156b1327ead708457e5fefe8cdc (diff)
downloadinfinitytier-eff1fe3c61aee8029337971545da5251f470ac53.tar.gz
infinitytier-eff1fe3c61aee8029337971545da5251f470ac53.zip
Create files for each hop (more convenient) and fix a packet parse bug.
Diffstat (limited to 'node')
-rw-r--r--node/IncomingPacket.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp
index 443ffeeb..9f53a1c5 100644
--- a/node/IncomingPacket.cpp
+++ b/node/IncomingPacket.cpp
@@ -1021,9 +1021,11 @@ bool IncomingPacket::_doCIRCUIT_TEST(const RuntimeEnvironment *RR,const SharedPt
outp.append(field(remainingHopsPtr,size() - remainingHopsPtr),size() - remainingHopsPtr);
for(unsigned int h=0;h<breadth;++h) {
- outp.newInitializationVector();
- outp.setDestination(nextHop[h]);
- RR->sw->send(outp,true,originatorCredentialNetworkId);
+ if (RR->identity.address() != nextHop[h]) { // next hops that loop back to the current hop are not valid
+ outp.newInitializationVector();
+ outp.setDestination(nextHop[h]);
+ RR->sw->send(outp,true,originatorCredentialNetworkId);
+ }
}
}
@@ -1067,7 +1069,7 @@ bool IncomingPacket::_doCIRCUIT_TEST_REPORT(const RuntimeEnvironment *RR,const S
if (report.nextHopCount > ZT_CIRCUIT_TEST_MAX_HOP_BREADTH) // sanity check, shouldn't be possible
report.nextHopCount = ZT_CIRCUIT_TEST_MAX_HOP_BREADTH;
for(unsigned int h=0;h<report.nextHopCount;++h) {
- report.nextHops[h].address = at<uint64_t>(nhptr); nhptr += 8;
+ report.nextHops[h].address = Address(field(nhptr,ZT_ADDRESS_LENGTH),ZT_ADDRESS_LENGTH).toInt(); nhptr += ZT_ADDRESS_LENGTH;
nhptr += reinterpret_cast<InetAddress *>(&(report.nextHops[h].physicalAddress))->deserialize(*this,nhptr);
}