kamax-matrix / mxisd

Federated Matrix Identity Server
GNU Affero General Public License v3.0
223 stars 115 forks source link

IPv6 connections break recursive lookups #2

Closed maxidorius closed 7 years ago

maxidorius commented 7 years ago
2017-03-02 16:38:28.866 ERROR 20163 --- [nio-8090-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet]  in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: Could not parse [0:0:0:0: 0:0:0:1]] with root cause

java.lang.IllegalArgumentException: Could not parse [0:0:0:0:0:0:0:1]
        at org.apache.commons.net.util.SubnetUtils.toInteger(SubnetUtils.java:287) ~[commons-net-3.5.jar:3.5]
        at org.apache.commons.net.util.SubnetUtils.access$400(SubnetUtils.java:27) ~[commons-net-3.5.jar:3.5]
        at org.apache.commons.net.util.SubnetUtils$SubnetInfo.isInRange(SubnetUtils.java:125) ~[commons-net-3.5.jar:3.5]
        at org.apache.commons.net.util.SubnetUtils$SubnetInfo$isInRange.call(Unknown Source) ~[na:na]
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) ~[groovy-all-2.4.7.jar:2.4.7]
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) ~[groovy-all-2.4.7.jar:2.4.7]
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) ~[groovy-all-2.4.7.jar:2.4.7]
        at io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy.find(RecursivePriorityLookupStrategy.groovy:76) ~[main/:na]
        at io.kamax.mxisd.lookup.strategy.LookupStrategy$find.call(Unknown Source) ~[na:na]
...

SubnetUtils, which is part of Apache Commons Net, does not support IPv6.

ReqX commented 7 years ago

Thx Max, much appreciated! Just tested it and works fine (curl without -4 on known install)