From 3504bddea40e7b2efbfb88fedf4a2fd8781e81d8 Mon Sep 17 00:00:00 2001 From: zzz Date: Wed, 4 Sep 2019 13:49:29 +0000 Subject: [PATCH] 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 --- .../i2p/router/transport/udp/UDPTransport.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java index 6407dc9b5..f7d80deaa 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -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; }