You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2024/01/26 16:15:00 UTC

[jira] [Commented] (NET-728) SubnetUtils.isInRange(String address) is not working with CIDR input

    [ https://issues.apache.org/jira/browse/NET-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811335#comment-17811335 ] 

Gary D. Gregory commented on NET-728:
-------------------------------------

[~jperkins]
It looks to me like there is a basic misunderstand of how {{SubnetUtils}} works. Please see:
* {{SubnetUtils.setInclusiveHostCount(boolean)}} in got master
* {{SubnetUtilsNet728Test}}


> SubnetUtils.isInRange(String address) is not working with CIDR input
> --------------------------------------------------------------------
>
>                 Key: NET-728
>                 URL: https://issues.apache.org/jira/browse/NET-728
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 3.10.0
>         Environment: Windows application using commons-net library (version 3.10).
>            Reporter: Jared Perkins
>            Priority: Major
>         Attachments: SubNetUtilsTest.java, mira_screenshot_of_CIDR.png
>
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)