[
https://issues.apache.org/jira/browse/NET-622?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sebb resolved NET-622.
----------------------
Resolution: Fixed
Fix Version/s: 3.7
Thanks, fixed:
URL: http://svn.apache.org/viewvc?rev=1786507&view=rev
Log:
NET-624 SubnetInfo#getCidrSignature - improve functions
Modified:
commons/proper/net/trunk/src/changes/changes.xml
commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java
> SubnetInfo#getCidrSignature - improve functions
> -----------------------------------------------
>
> Key: NET-622
> URL: https://issues.apache.org/jira/browse/NET-622
> Project: Commons Net
> Issue Type: Improvement
> Reporter: Makoto Sakaguchi
> Priority: Minor
> Fix For: 3.7
>
>
> The processing part of "netmask" is converted an integer to a string to an
> integer.
> {code}
> /* SubnetUtils.SubnetInfo#getCidrSignature() */
> // a binary mask address
> int netmask = 0b11111111000000000000000000000000;
> // convert to a dotted decimal address
> String maskStr = format(toArray(netmask)); // maskStr: "255.0.0.0"
> /* SubnetUtils#toCidrNotation() */
> // counting the 1-bit population
> int cidr = pop(toInteger(maskStr)); // cidr: 8
> {code}
> So, I suggest to create CIDR from the netmask variable.
> https://github.com/apache/commons-net/pull/10
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)