Transport: More invalid ports

This commit is contained in:
zzz
2017-08-22 12:42:14 +00:00
parent 1efc1677a3
commit d77cd04061
2 changed files with 10 additions and 2 deletions

View File

@ -221,6 +221,7 @@ public abstract class TransportUtil {
* Is this a valid port for us or a remote router? * Is this a valid port for us or a remote router?
* *
* ref: http://i2p-projekt.i2p/en/docs/ports * ref: http://i2p-projekt.i2p/en/docs/ports
* ref: https://cs.chromium.org/chromium/src/net/base/port_util.cc
* *
* @since 0.9.17 moved from logic in individual transports * @since 0.9.17 moved from logic in individual transports
*/ */
@ -229,12 +230,19 @@ public abstract class TransportUtil {
return port >= 1024 && return port >= 1024 &&
port <= 65535 && port <= 65535 &&
port != 1900 && // UPnP SSDP port != 1900 && // UPnP SSDP
port != 2049 && // NFS
port != 2827 && // BOB port != 2827 && // BOB
port != 3659 && // Apple-sasl
port != 4045 && // lockd
port != 4444 && // HTTP port != 4444 && // HTTP
port != 4445 && // HTTPS port != 4445 && // HTTPS
port != 6668 && // IRC port != 6000 && // lockd
(!(port >= 6665 && port <= 6669)) && // IRC and alternates
port != 6697 && // IRC+TLS
(!(port >= 7650 && port <= 7664)) && // standard I2P range (!(port >= 7650 && port <= 7664)) && // standard I2P range
port != 8998 && // mtn port != 8998 && // mtn
port != 9100 && // network printer
// do not block anything in 9111 - 30777, this is the standard random selection range
port != 31000 && // Wrapper port != 31000 && // Wrapper
port != 32000; // Wrapper port != 32000; // Wrapper
} }

View File

@ -116,7 +116,7 @@ class UDPEndpoint implements SocketListener {
if (port > 0 && !TransportUtil.isValidPort(port)) { if (port > 0 && !TransportUtil.isValidPort(port)) {
_log.error("Specified UDP port " + port + " is not valid, selecting a new port"); _log.error("Specified UDP port " + port + " is not valid, selecting a new port");
// See isValidPort() for list // See isValidPort() for list
_log.error("Invalid ports are: 0-1023, 1900, 2827, 4444, 4445, 6668, 7650-7664, 8998, 31000, 32000, 65536+"); _log.error("Invalid ports are: 0-1023, 1900, 2049, 2827, 3659, 4045, 4444, 4445, 6000, 6665-6669, 6697, 7650-7664, 8998, 9100, 31000, 32000, 65536+");
port = -1; port = -1;
} }