You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "David Tarr (Jira)" <ji...@apache.org> on 2019/11/25 11:21:00 UTC
[jira] [Commented] (NET-675) SubnetUtils/SubnetInfo does not
compute range for /32 subnet
[ https://issues.apache.org/jira/browse/NET-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16981456#comment-16981456 ]
David Tarr commented on NET-675:
--------------------------------
I am not sure if this contributes to this Jira, but https://www.ipaddressguide.com/cidr does show the 'range' correctly.
> SubnetUtils/SubnetInfo does not compute range for /32 subnet
> ------------------------------------------------------------
>
> Key: NET-675
> URL: https://issues.apache.org/jira/browse/NET-675
> Project: Commons Net
> Issue Type: Bug
> Affects Versions: 3.6
> Reporter: David Tarr
> Priority: Major
>
> If a SubnetUtils is created using a cidr notation of a single ip-address, the isInRange returns false for the ip-address.
> Example code:
> {code:java}
> String subnet = "192.168.0.15/32";
> SubnetUtils subnetUtils = new SubnetUtils(subnet);
> SubnetInfo info = subnetUtils.getInfo();
> log.debug("{}", info); // first and last ip-address are 0.0.0.0
> log.debug("{}", info.isInRange("192.168.0.15")); // false is returned, I would expect true
> log.debug("{}", subnetInfo.getAddress())); // the exact address is returned
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)