You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2013/12/06 20:43:36 UTC
[jira] [Updated] (NET-513) [patch
attached]SubnetUtils.SubnetInfo.getAllAddresses() Doesn't return all
addresses
[ https://issues.apache.org/jira/browse/NET-513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb updated NET-513:
---------------------
Priority: Major (was: Blocker)
> [patch attached]SubnetUtils.SubnetInfo.getAllAddresses() Doesn't return all addresses
> -------------------------------------------------------------------------------------
>
> Key: NET-513
> URL: https://issues.apache.org/jira/browse/NET-513
> Project: Commons Net
> Issue Type: Bug
> Affects Versions: 3.3
> Reporter: akash kushwaha
> Labels: easyfix, patch
>
> Couln't find Utils in components so filing in telnet.
> SubnetInfo.getAllAddresses() Doesn't return all addresses, but return all but 2 addresses.
> Fixing code at following lines worked for me.
> private int low() { return network() ; }
> private int high() { return broadcast() ; }
> public int getAddressCount() { return (broadcast() - low() + 1); }
> //j < addresses.length added as for loop will run infinitely when high is Integer.MAX_VALUE test case: 127.0.0.0/8
> for (int add = low(), j=0; add <= high() && j < addresses.length; ++add, ++j) {
--
This message was sent by Atlassian JIRA
(v6.1#6144)