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

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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment