SSU: Don't mark peer unreachable if it reports we have a bad port,

as it could be due to the NAT external port range (ticket #2467)
Add log message
This commit is contained in:
zzz
2019-09-04 13:49:29 +00:00
parent b3a5f1f8c1
commit 3504bddea4

View File

@ -938,10 +938,18 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
if (!isValid) {
// ignore them
if (_log.shouldLog(Log.ERROR))
_log.error("The router " + from + " told us we have an invalid IP:port "
+ Addresses.toString(ourIP, ourPort));
markUnreachable(from);
// ticket #2467 natted to an invalid port
// if the port is the only issue, don't call markUnreachable()
if (ourPort < 1024 || ourPort > 65535 || !isValid(ourIP)) {
if (_log.shouldWarn())
_log.warn("The router " + from + " told us we have an invalid IP:port "
+ Addresses.toString(ourIP, ourPort));
markUnreachable(from);
} else {
_log.logAlways(Log.WARN, "The router " + from + " told us we have an invalid port "
+ ourPort
+ ", check NAT/firewall configuration, the IANA recommended dynamic outside port range is 49152-65535");
}
//_context.banlist().banlistRouter(from, "They said we had an invalid IP", STYLE);
return;
}