Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-773

org.apache.mina.filter.firewall.Subnet should consider 0.0.0.0/0 as a subnet that contains 'all the ipv4 addresses'

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-RC1
    • Fix Version/s: 2.0.8
    • Component/s: Filter
    • Labels:

      Description

      One of our users when trying to implement a WhilteListFilter found the problem that there is no way to declare a subnet that would comprise any ip address.

      As discussed in dev-mailing list, a 0.0.0.0/0 subnet should return always true for Subnet.inSubnet( any_ipv4_address)

        Activity

        Hide
        elecharny Emmanuel Lecharny added a comment -

        I guess that something like :

            public boolean inSubnet(InetAddress address) {
                if (address.isAnyLocalAddress()) {
                    return true;
                }
        
                return toSubnet(address) == subnetInt;
            }
        

        would do the trick

        Show
        elecharny Emmanuel Lecharny added a comment - I guess that something like : public boolean inSubnet(InetAddress address) { if (address.isAnyLocalAddress()) { return true ; } return toSubnet(address) == subnetInt; } would do the trick
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Fixed with commit faa8e58e11a3fa50e5169f6f9c1119d275199fec

        Show
        elecharny Emmanuel Lecharny added a comment - Fixed with commit faa8e58e11a3fa50e5169f6f9c1119d275199fec

          People

          • Assignee:
            Unassigned
            Reporter:
            dlatorre David Latorre
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development