commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (NET-513) [patch attached]SubnetUtils.SubnetInfo.getAllAddresses() Doesn't return all addresses
Date Fri, 06 Dec 2013 19:55:36 GMT

     [ https://issues.apache.org/jira/browse/NET-513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sebb updated NET-513:
---------------------

    Labels:   (was: easyfix patch)

> [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
>
> 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)

Mime
View raw message