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 2014/02/11 02:28:19 UTC

[jira] [Resolved] (NET-523) SubnetUtils constructor fails on /32 subnets

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

Sebb resolved NET-523.
----------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.2)
                   3.1

NET 2.x is no longer being developed.

AFAICT the current NET 3.x versions don't have the problem

> SubnetUtils constructor fails on /32 subnets
> --------------------------------------------
>
>                 Key: NET-523
>                 URL: https://issues.apache.org/jira/browse/NET-523
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: All
>            Reporter: Victor Romero
>             Fix For: 3.1
>
>
> The following code:
> SubnetUtils subnetUtils = new SubnetUtils("192.168.0.1/32");
> throws the following exception:
> Exception in thread "main" java.lang.IllegalArgumentException: Value [32] not in range (-1,31]
> 	at org.apache.commons.net.util.SubnetUtils.rangeCheck(SubnetUtils.java:216)
> 	at org.apache.commons.net.util.SubnetUtils.calculate(SubnetUtils.java:141)
> 	at org.apache.commons.net.util.SubnetUtils.<init>(SubnetUtils.java:46)
> 	at com.gs.configmgt.proteus.model.impl.TestTest.main(TestTest.java:12)
> /32 is a perfectly valid subnet of one host. See wikipedia for verification: http://en.wikipedia.org/wiki/IPv4_subnetting_reference.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)