Changeset 82d812c for core


Ignore:
Timestamp:
Feb 4, 2017 3:38:49 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6306799
Parents:
890ad25
Message:

NTP: Enable IPv6 support (ticket #1896)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/Addresses.java

    r890ad25 r82d812c  
    5757        // not as good as using a Java DBus implementation to talk to NetworkManager...
    5858        return !getAddresses(true, false, false).isEmpty();
     59    }
     60
     61    /**
     62     *  Do we have any non-loop, non-wildcard IPv6 address at all?
     63     *  @since 0.9.29
     64     */
     65    public static boolean isConnectedIPv6() {
     66        // not as good as using a Java DBus implementation to talk to NetworkManager...
     67        for (String ip : getAddresses(false, true)) {
     68            if (ip.contains(":"))
     69                return true;
     70        }
     71        return false;
    5972    }
    6073
     
    600613            System.out.println(buf.toString());
    601614        }
    602         System.out.println("\nIs connected? " + isConnected());
     615        System.out.println("\nIs connected? " + isConnected() +
     616                           "\nHas IPv6?     " + isConnectedIPv6());
    603617    }
    604618}
Note: See TracChangeset for help on using the changeset viewer.