[
https://issues.apache.org/jira/browse/NET-675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sebb resolved NET-675.
----------------------
Resolution: Invalid
By default, isInRange does not include the network and broadcast addresses.
http://commons.apache.org/proper/commons-net/javadocs/api-3.6/org/apache/commons/net/util/SubnetUtils.SubnetInfo.html#isInRange(java.lang.String)
Use SubnetUtils.setInclusiveHostCount(true) to change the default
> 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)