You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "pin_ptr (JIRA)" <ji...@apache.org> on 2017/07/09 16:56:02 UTC

[jira] [Created] (NET-641) SubnetUtils.SubnetInfo.isInRange("0.0.0.0") returns incorrect value

pin_ptr created NET-641:
---------------------------

             Summary: SubnetUtils.SubnetInfo.isInRange("0.0.0.0") returns incorrect value
                 Key: NET-641
                 URL: https://issues.apache.org/jira/browse/NET-641
             Project: Commons Net
          Issue Type: Bug
    Affects Versions: 3.6
         Environment: Windows; JDK8; common-net 3.6
            Reporter: pin_ptr
            Priority: Minor


Code:
import org.apache.commons.net.util.SubnetUtils;

public class A {
  public static void main(String[] args) {
    System.out.println(new SubnetUtils("192.168.1.0/30").getInfo().isInRange("0.0.0.0"));
    System.out.println(new SubnetUtils("192.168.1.0/31").getInfo().isInRange("0.0.0.0"));
    System.out.println(new SubnetUtils("192.168.1.0/32").getInfo().isInRange("0.0.0.0"));
  }
}

Result:
false
true
true

Expected:
false
false
false




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)