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

method SubnetUtils.SubnetInfo.isInRange(addr) returns incorrect result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.2
    • None
    • None

    Description

      current implementation failing to check low limit:

      private boolean isInRange(int address)      { return ((address-low()) <= (high()-low())); }
      

      suggested fix:

      private boolean isInRange(int address)      { 
          normal = address-low();
          return (normal>=0 && (normal <= (high()-low())));
      }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zakon Pasha Arājums
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: