Progr1mmer před 6 roky
rodič
revize
6516524e12

+ 4 - 1
utils/src/main/java/com/yihu/utils/network/IPInfoUtils.java

@ -28,7 +28,10 @@ public class IPInfoUtils {
        return a * 256 * 256 * 256 + b * 256 * 256 + c * 256 + d;
    }
    public static boolean isInnerIP(String ip){
    public static boolean isInnerIP (String ip){
        if ("0:0:0:0:0:0:0:1".equals(ip) || "127.0.0.1".equals(ip)) {
            return true;
        }
        long n = getIpNum(ip);
        return (n >= A1 && n <= A2) || (n >= B1 && n <= B2) || (n >= C1 && n <= C2) || (n >= D1 && n <= D2) || (n >= E1 && n<=E2);
    }