Dear All,

      Today I got a mail from Apache MINA for [ANNOUNCE] Apache MINA 2.0.8
release and I could see that one of the bug raised by me
https://issues.apache.org/jira/browse/DIRMINA-957 was fixed. So I downloaded
the Mina 2.0.8 and also source code to see the fix and I found the
following.

 

I checked the org.apache.mina.filter.firewall.Subnet class

 

The check for IPv4 is still there and it throws exception so the code will
never go further where IPv6 support is written. 

 

public Subnet(InetAddress subnet, int mask) {

        if (subnet == null) {

            throw new IllegalArgumentException("Subnet address can not be
null");

        }

 

        if (!(subnet instanceof Inet4Address)) {

            throw new IllegalArgumentException("Only IPv4 supported");

        }

 

        if (subnet instanceof Inet4Address) {

            // IPV4 address

            if ((mask < 0) || (mask > 32)) {

                throw new IllegalArgumentException("Mask has to be an
integer between 0 and 32 for an IPV4 address");

            } else {

                this.subnet = subnet;

                subnetInt = toInt(subnet);

                this.suffix = mask;

 

                // binary mask for this subnet

                this.subnetMask = IP_MASK_V4 >> (mask - 1);

            }

        } else {

            // IPV6 address

            if ((mask < 0) || (mask > 128)) {

                throw new IllegalArgumentException("Mask has to be an
integer between 0 and 128 for an IPV6 address");

            } else {

                this.subnet = subnet;

                subnetLong = toLong(subnet);

                this.suffix = mask;

 

                // binary mask for this subnet

                this.subnetMask = IP_MASK_V6 >> (mask - 1);

            }

        }

    }

 

 

Thanks And Regards,

Nitin Phuria

 

-----Original Message-----
From: Nitin Phuria [mailto:[email protected]] 
Sent: Friday, July 26, 2013 12:41 PM
To: [email protected]
Subject: RE: Does MINA 2.0.4 supports IPV6

 

The issue is registered in JIRA see the below link.

https://issues.apache.org/jira/browse/DIRMINA-957 

 

Thanks And Regards,

Nitin Phuria

 

-----Original Message-----

From: Emmanuel Lécharny [mailto:[email protected]] 

Sent: Thursday, July 25, 2013 6:49 PM

To: [email protected]

Subject: Re: Does MINA 2.0.4 supports IPV6

 

Le 7/25/13 1:47 PM, Nitin Phuria a écrit :

> Hello All,

> 

> MINA build in BlacklistFilter does not support IPV6 address. If MINA

itself

> supports binding to IPV4 and IPV6 why this restriction was kept in

> BlacklistFilter. 

 

That's a different problem...

 

 

> I checked the org.apache.mina.filter.firewall.Subnet class

> in MINA sources and found that it specifically checks for Inet4Address

> 

> if (!(subnet instanceof Inet4Address)) 

> {

>      throw new IllegalArgumentException("Only IPv4 supported");

> }

> 

> We are using this filter and now supports only IPV4

> 

> Pls advice.

 

Please fill a JIRA, we are going to look at it.

 

ATM, I suggest you remove this check from the code, and see if it works

for you. If so, we could then patch MINA, this is probably the fastest

way to solve your issue.

 

 

-- 

Regards,

Cordialement,

Emmanuel Lécharny

www.iktek.com 

 

 

Reply via email to