commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NET-268) SubnetUtilsTest does not include any tests for CIDR with /30, /31, /32
Date Thu, 31 Mar 2011 01:03:05 GMT

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

Sebb commented on NET-268:
--------------------------

Looking further at this, the code seems to work OK for CIDR/30 in all cases.

The code also works OK for CIDR/31 and CIDR/32 provided that setInclusiveHostCount(true) is
used to override the default.

When inclusiveHostCount is false, there is a problem, because the the network address and
the broadcast address differ by only 1 for CIDR/31, and are the same for CIDR/32. There are
no possible low or high addresses in these cases.

Clearly the addressCount() in these cases should return 0. 
It's not clear what the lo and high addresses should return, if anything. 
Perhaps the code should throw an Exception?

> SubnetUtilsTest  does not include any tests for CIDR with /30, /31, /32
> -----------------------------------------------------------------------
>
>                 Key: NET-268
>                 URL: https://issues.apache.org/jira/browse/NET-268
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Sebb
>
> SubnetUtilsTest  does not include any tests for CIDRs with masks of /30, /31, /32
> It only includes tests for /8 /16 /24 and /29, plus a test for the (invalid) /0.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message