[
https://issues.apache.org/jira/browse/DIRMINA-957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nitin Phuria reopened DIRMINA-957:
----------------------------------
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);
}
}
}
> MINA build in BlacklistFilter does not support IPV6 address
> -----------------------------------------------------------
>
> Key: DIRMINA-957
> URL: https://issues.apache.org/jira/browse/DIRMINA-957
> Project: MINA
> Issue Type: Bug
> Components: Filter
> Affects Versions: 2.0.7
> Reporter: Nitin Phuria
> Labels: security
> Fix For: 2.0.8
>
>
> 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. 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");
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)