Changeset fdb1f9dd


Ignore:
Timestamp:
Mar 10, 2012 10:07:15 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d598396b
Parents:
9e3b49d
Message:

IPv4 check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java

    r9e3b49d rfdb1f9dd  
    296296        try {
    297297            int boundAddresses = 0;
    298             boolean hasIPV6 = Addresses.getAllAddresses().contains("0:0:0:0:0:0:0:0");
     298            Set addresses = Addresses.getAllAddresses();
     299            boolean hasIPV4 = addresses.contains("0.0.0.0");
     300            boolean hasIPV6 = addresses.contains("0:0:0:0:0:0:0:0");
    299301
    300302            // add standard listeners
     
    317319                        if ((!hasIPV6) && (!(test instanceof Inet4Address)))
    318320                            throw new IOException("IPv6 addresses unsupported, you may ignore this warning if the console is still available at http://127.0.0.1:7657");
     321                        if ((!hasIPV4) && (test instanceof Inet4Address))
     322                            throw new IOException("IPv4 addresses unsupported, you may ignore this warning if the console is still available at http://localhost:7657");
    319323                        //if (host.indexOf(":") >= 0) // IPV6 - requires patched Jetty 5
    320324                        //    _server.addListener('[' + host + "]:" + _listenPort);
     
    360364                            if ((!hasIPV6) && (!(test instanceof Inet4Address)))
    361365                                throw new IOException("IPv6 addresses unsupported, you may ignore this warning if the console is still available at http://127.0.0.1:7657");
     366                            if ((!hasIPV4) && (test instanceof Inet4Address))
     367                                throw new IOException("IPv4 addresses unsupported, you may ignore this warning if the console is still available at http://localhost:7657");
    362368                            // TODO if class not found use SslChannelConnector
    363369                            // Sadly there's no common base class with the ssl methods in it
Note: See TracChangeset for help on using the changeset viewer.