From 8e7e3c2b111c8ee72c467accf1d99562c61fefa4 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 3 Sep 2019 12:58:23 -0700 Subject: [PATCH] Fix max hops. --- node/Constants.hpp | 2 +- root/root.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/node/Constants.hpp b/node/Constants.hpp index 9474338c1..862676b87 100644 --- a/node/Constants.hpp +++ b/node/Constants.hpp @@ -248,7 +248,7 @@ * * The protocol allows up to 7, but we limit it to something smaller. */ -#define ZT_RELAY_MAX_HOPS 4 +#define ZT_RELAY_MAX_HOPS 3 /** * Expire time for multicast 'likes' and indirect multicast memberships in ms diff --git a/root/root.cpp b/root/root.cpp index 8a9324d8d..15d3c22d3 100644 --- a/root/root.cpp +++ b/root/root.cpp @@ -558,13 +558,13 @@ static void handlePacket(const int v4s,const int v6s,const InetAddress *const ip } if (fragment) { - if (reinterpret_cast(&pkt)->incrementHops() >= ZT_PROTO_MAX_HOPS) { - printf("%s refused to forward to %s: max hop count exceeded" ZT_EOL_S,ip->toString(ipstr),dest.toString(astr)); + if (reinterpret_cast(&pkt)->incrementHops() >= ZT_RELAY_MAX_HOPS) { + //printf("%s refused to forward to %s: max hop count exceeded" ZT_EOL_S,ip->toString(ipstr),dest.toString(astr)); return; } } else { if (pkt.incrementHops() >= ZT_PROTO_MAX_HOPS) { - printf("%s refused to forward to %s: max hop count exceeded" ZT_EOL_S,ip->toString(ipstr),dest.toString(astr)); + //printf("%s refused to forward to %s: max hop count exceeded" ZT_EOL_S,ip->toString(ipstr),dest.toString(astr)); return; } }