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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: