commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (NET-651) Ip Range Check with SubnetUtils provides incorrect answer
Date Mon, 22 Jan 2018 15:10:00 GMT

     [ https://issues.apache.org/jira/browse/NET-651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sebb updated NET-651:
---------------------
    Summary: Ip Range Check with SubnetUtils provides incorrect answer  (was: Ip Range Check
with Subnte utils provides in correct answer)

> Ip Range Check with SubnetUtils provides incorrect answer
> ---------------------------------------------------------
>
>                 Key: NET-651
>                 URL: https://issues.apache.org/jira/browse/NET-651
>             Project: Commons Net
>          Issue Type: Bug
>            Reporter: sathyam
>            Priority: Critical
>
> {code:java}
> private static void checkIp() {
>  System.out.println(verifyCommonsNet("192.168.0.1", "192.168.0.1/32"));
>  System.out.println(verifySpringSecurity("192.168.0.1", "192.168.0.1/32"));
> }
> private static boolean verifyCommonsNet(String ip, String subnet) {
>  SubnetUtils.SubnetInfo subnetInfo = (new SubnetUtils(subnet)).getInfo();
>  return subnetInfo.isInRange(ip);
> }
> private static boolean verifySpringSecurity(String ip, String subnet) {
>  IpAddressMatcher ipAddressMatcher = new IpAddressMatcher(subnet);
>  return ipAddressMatcher.matches(ip);
> }{code}
>  
> Tried to check Ip range functionality with Subnet Utils. But I get an incorrect answer
when using mask of 32. The same CIDR with Spring security provides the right answer. checking 192.168.0.1
against 192.168.0.1/32 should return true. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message