mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Fix max hops.
This commit is contained in:
parent
0e7df129d8
commit
8e7e3c2b11
2 changed files with 4 additions and 4 deletions
|
@ -248,7 +248,7 @@
|
||||||
*
|
*
|
||||||
* The protocol allows up to 7, but we limit it to something smaller.
|
* 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
|
* Expire time for multicast 'likes' and indirect multicast memberships in ms
|
||||||
|
|
|
@ -558,13 +558,13 @@ static void handlePacket(const int v4s,const int v6s,const InetAddress *const ip
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fragment) {
|
if (fragment) {
|
||||||
if (reinterpret_cast<Packet::Fragment *>(&pkt)->incrementHops() >= ZT_PROTO_MAX_HOPS) {
|
if (reinterpret_cast<Packet::Fragment *>(&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));
|
//printf("%s refused to forward to %s: max hop count exceeded" ZT_EOL_S,ip->toString(ipstr),dest.toString(astr));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (pkt.incrementHops() >= ZT_PROTO_MAX_HOPS) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue