Changeset 2d43d34


Ignore:
Timestamp:
Dec 2, 2014 1:22:26 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f1e9f5d4
Parents:
1773fc0
Message:

add more invalid ports

Location:
router/java/src/net/i2p/router/transport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/TransportUtil.java

    r1773fc0 r2d43d34  
    174174     *  Is this a valid port for us or a remote router?
    175175     *
     176     *  ref: http://i2p-projekt.i2p/en/docs/ports
     177     *
    176178     *  @since 0.9.17 moved from logic in individual transports
    177179     */
    178180    public static boolean isValidPort(int port) {
     181        // update log message in UDPEndpoint if you update this list
    179182        return port >= 1024 &&
    180183               port <= 65535 &&
    181                port != 1900;    // UPnP SSDP
     184               port != 1900 &&  // UPnP SSDP
     185               port != 2827 &&  // BOB
     186               port != 4444 &&  // HTTP
     187               port != 4445 &&  // HTTPS
     188               port != 6668 &&  // IRC
     189               (!(port >= 7650 && port <= 7664)) && // standard I2P range
     190               port != 8998 &&  // mtn
     191               port != 31000 && // Wrapper
     192               port != 32000;   // Wrapper
    182193    }
    183194}
  • router/java/src/net/i2p/router/transport/udp/UDPEndpoint.java

    r1773fc0 r2d43d34  
    114114        DatagramSocket socket = null;
    115115        int port = _listenPort;
    116         if (port > 0 && !TransportUtil.isValidPort(port))
    117             _log.error("Specified UDP port is " + port + ", ports lower than 1024 not recommended");
     116        if (port > 0 && !TransportUtil.isValidPort(port)) {
     117            _log.error("Specified UDP port " + port + " is not valid, selecting a new port");
     118            // See isValidPort() for list
     119            _log.error("Invalid ports are: 0-1023, 1900, 2827, 4444, 4445, 6668, 7650-7664, 8998, 31000, 32000, 65536+");
     120            port = -1;
     121        }
    118122
    119123        for (int i = 0; i < MAX_PORT_RETRIES; i++) {
Note: See TracChangeset for help on using the changeset viewer.