Changeset 5cd1419 for router


Ignore:
Timestamp:
Feb 28, 2018 5:58:28 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d167b5e
Parents:
f129426e
Message:

Util: Add methods to validate IP addresses

Location:
router/java/src/net/i2p
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/data/router/RouterAddress.java

    rf129426e r5cd1419  
    1717import java.util.Map;
    1818import java.util.Properties;
    19 
    20 import org.apache.http.conn.util.InetAddressUtils;
    2119
    2220import net.i2p.data.DataFormatException;
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    rf129426e r5cd1419  
    2424import java.util.Vector;
    2525import java.util.concurrent.ConcurrentHashMap;
    26 
    27 import org.apache.http.conn.util.InetAddressUtils;
    2826
    2927import net.i2p.crypto.SigType;
     
    10031001            if (h.length() <= 0)
    10041002                continue;
    1005             if (InetAddressUtils.isIPv4Address(h)) {
     1003            if (Addresses.isIPv4Address(h)) {
    10061004                if (v4)
    10071005                    continue;
    10081006                v4 = true;
    10091007                ipstrings.add(h);
    1010             } else if (InetAddressUtils.isIPv6Address(h)) {
     1008            } else if (Addresses.isIPv6Address(h)) {
    10111009                if (v6)
    10121010                    continue;
  • router/java/src/net/i2p/router/transport/udp/UDPAddress.java

    rf129426e r5cd1419  
    44import java.net.UnknownHostException;
    55import java.util.Map;
    6 
    7 import org.apache.http.conn.util.InetAddressUtils;
    86
    97import net.i2p.data.Base64;
     
    119import net.i2p.data.SessionKey;
    1210import net.i2p.router.transport.TransportUtil;
     11import net.i2p.util.Addresses;
    1312import net.i2p.util.LHMCache;
    1413import net.i2p.util.SystemVersion;
     
    340339        }
    341340        if (rv == null) {
    342             if (InetAddressUtils.isIPv4Address(host) ||
    343                 InetAddressUtils.isIPv6Address(host)) {
     341            if (Addresses.isIPAddress(host)) {
    344342                try {
    345343                    rv = InetAddress.getByName(host);
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    rf129426e r5cd1419  
    2020import java.util.concurrent.ConcurrentHashMap;
    2121import java.util.concurrent.CopyOnWriteArrayList;
    22 
    23 import org.apache.http.conn.util.InetAddressUtils;
    2422
    2523import net.i2p.crypto.SigType;
     
    20852083                    if (h.length() <= 0)
    20862084                        continue;
    2087                     if (InetAddressUtils.isIPv4Address(h)) {
     2085                    if (Addresses.isIPv4Address(h)) {
    20882086                        if (v4)
    20892087                            continue;
    20902088                        v4 = true;
    2091                     } else if (InetAddressUtils.isIPv6Address(h)) {
     2089                    } else if (Addresses.isIPv6Address(h)) {
    20922090                        if (v6)
    20932091                            continue;
Note: See TracChangeset for help on using the changeset viewer.