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

SubnetUtils.isInRange(String address) is not working with CIDR input

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Information Provided
    • 3.10.0
    • None
    • None
    • None
    • Windows application using commons-net library (version 3.10).

    Description

      I checked this website for CIDR notation to ensure it was accurrate:

      https://account.arin.net/public/cidrCalculator

      I utilized the IP address 10.65.0.151 and the prefix of 32.  From that website, it shows the only address available was 10.65.0.151.

      I instantiated SubnetUtils using CIDR notation "10.65.0.151/32".  I expected true to be returned when using the SubnetUtils.isInRange(String address) for "10.65.0.151".  However it does not return true, and it will only return true using prefix "30".

      I attached a crude unit test to demonstrate the issue.

      Attachments

        1. SubNetUtilsTest.java
          2 kB
          Jared Perkins
        2. mira_screenshot_of_CIDR.png
          24 kB
          Jared Perkins

        Activity

          People

            Unassigned Unassigned
            jperkins Jared Perkins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: