commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor Romero (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NET-305) SubnetUtils constructor fails on /32 subnets
Date Tue, 11 Feb 2014 14:02:20 GMT

    [ https://issues.apache.org/jira/browse/NET-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13897860#comment-13897860
] 

Victor Romero commented on NET-305:
-----------------------------------

And the code in 3.3 comes straight away from 2.2.


> SubnetUtils constructor fails on /32 subnets
> --------------------------------------------
>
>                 Key: NET-305
>                 URL: https://issues.apache.org/jira/browse/NET-305
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: All
>            Reporter: Kevin Schmidt
>             Fix For: 2.2
>
>
> 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)

Mime
View raw message