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 EB72810CE8 for ; Fri, 6 Dec 2013 19:55:36 +0000 (UTC) Received: (qmail 77261 invoked by uid 500); 6 Dec 2013 19:55:36 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 77111 invoked by uid 500); 6 Dec 2013 19:55:36 -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 77102 invoked by uid 99); 6 Dec 2013 19:55:36 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 19:55:36 +0000 Date: Fri, 6 Dec 2013 19:55:36 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (NET-513) [patch attached]SubnetUtils.SubnetInfo.getAllAddresses() Doesn't return all addresses 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-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)