[
https://issues.apache.org/jira/browse/NET-529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13940929#comment-13940929
]
Putinas Piliponis edited comment on NET-529 at 3/19/14 8:14 PM:
----------------------------------------------------------------
I provided example of 0.0.0.0/0 as most "obvious" one. Bug was closed only for
"0.0.0.0/0", but actually CIDR 0 is valid with any IP.
For example 10.10.10.10/0 is valid syntax. Here is output of popular unix
utility "whatmask":
whatmask 10.10.10.10/0
------------------------------------------------
TCP/IP NETWORK INFORMATION
------------------------------------------------
IP Entered = ..................: 10.10.10.10
CIDR = ........................: /0
Netmask = .....................: 0.0.0.0
Netmask (hex) = ...............: 0x00000000
Wildcard Bits = ...............: 255.255.255.255
------------------------------------------------
Network Address = .............: 0.0.0.0
Broadcast Address = ...........: 255.255.255.255
Usable IP Addresses = .........: 4294967294
First Usable IP Address = .....: 0.0.0.1
Last Usable IP Address = ......: 255.255.255.254
I would expect java class behave same.
was (Author: lapkritinis):
I provided example of 0.0.0.0/0 as most "obvious" one. Bug was closed only for
"0.0.0.0/0|, but actually CIDR 0 is valid with any IP.
For example 10.10.10.10/0 is valid syntax. Here is output of popular unix
utility "whatmask":
whatmask 10.10.10.10/0
------------------------------------------------
TCP/IP NETWORK INFORMATION
------------------------------------------------
IP Entered = ..................: 10.10.10.10
CIDR = ........................: /0
Netmask = .....................: 0.0.0.0
Netmask (hex) = ...............: 0x00000000
Wildcard Bits = ...............: 255.255.255.255
------------------------------------------------
Network Address = .............: 0.0.0.0
Broadcast Address = ...........: 255.255.255.255
Usable IP Addresses = .........: 4294967294
First Usable IP Address = .....: 0.0.0.1
Last Usable IP Address = ......: 255.255.255.254
I would expect java class behave same.
> SubnetUtils throws exception on valid input
> -------------------------------------------
>
> Key: NET-529
> URL: https://issues.apache.org/jira/browse/NET-529
> Project: Commons Net
> Issue Type: Bug
> Affects Versions: 3.3
> Reporter: Putinas Piliponis
> Labels: SubnetUtils
>
> I think that 0.0.0.0/0 should be accepted value by SubnetUtils. (it's quite
> commonly found on internet - indicating basically ALL ipv4 addresses).
> Test case:
> SubnetUtils subnetUtils = new SubnetUtils("0.0.0.0/0");
> However it throws exception:
> java.lang.IllegalArgumentException: Value [0] not in range (0,32]
> org.apache.commons.net.util.SubnetUtils.rangeCheck(SubnetUtils.java:304)
> org.apache.commons.net.util.SubnetUtils.calculate(SubnetUtils.java:229)
> org.apache.commons.net.util.SubnetUtils.<init>(SubnetUtils.java:52)
--
This message was sent by Atlassian JIRA
(v6.2#6252)