Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7FE8810362 for ; Mon, 10 Feb 2014 21:17:59 +0000 (UTC) Received: (qmail 58860 invoked by uid 500); 10 Feb 2014 21:17:38 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 58568 invoked by uid 500); 10 Feb 2014 21:17:33 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 58357 invoked by uid 99); 10 Feb 2014 21:17:28 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2014 21:17:28 +0000 Date: Mon, 10 Feb 2014 21:17:28 +0000 (UTC) From: "Victor Romero (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (NET-523) SubnetUtils constructor fails on /32 subnets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/NET-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13897021#comment-13897021 ] Victor Romero commented on NET-523: ----------------------------------- The method SubnetUtils::setInclusiveHostCount(boolean) does not fix this 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: 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.(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)