Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-529

SubnetUtils throws exception on valid input

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Component/s: None
    • Labels:

      Description

      I think that xx.yy.zz.aa/0 should be accepted value by SubnetUtils, where xx.yy.zz.aa is any valid IPv4 IP address.

      Test case:
      SubnetUtils subnetUtils = new SubnetUtils("10.10.10.10/0");

      However it throws exception:

      java.lang.IllegalArgumentException: Value [0] not in range (0,32]
      org.apache.commons.net.util.SubnetUtils.rangeCheck(SubnetUtils.java:304)
      org.apache.commons.net.util.SubnetUtils.calculate(SubnetUtils.java:229)
      org.apache.commons.net.util.SubnetUtils.<init>(SubnetUtils.java:52)

      (I have updated issue description from original, to reflect that issue is not only with 0.0.0.0/0)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Lapkritinis Putinas Piliponis
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: