[
https://issues.apache.org/jira/browse/NET-513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
akash kushwaha updated NET-513:
-------------------------------
Description:
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) {
was:
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) {
> [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
> Components: Telnet
> Affects Versions: 3.3
> Reporter: akash kushwaha
> Priority: Blocker
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira