#292 IPAddressUtils barfs on IPv6 address

open
nobody
2
2007-08-10
2007-08-10
Ernst de Haan
No

I got the following error. Don't ask me why I got an IPv6 address in there...

1052 ERROR Programming error detected by class org.xins.common.Utils, method logProgrammingError in class java.lang.Thread, method run. Caught unexpected org.xins.common.ProgrammingException. Exception message: "Programming error suspected in class java.lang.Thread, method run. Detected by class org.xins.server.API, method allow. Detail: "Malformed IP address: "0:0:0:0:0:0:0:1%0".".". Detail: (null).
org.xins.common.text.ParseException: The string "0:0:0:0:0:0:0:1%0" is not a valid IP address.
at org.xins.common.net.IPAddressUtils.newParseException(IPAddressUtils.java:243)
at org.xins.common.net.IPAddressUtils.ipPartToInt(IPAddressUtils.java:144)
at org.xins.common.net.IPAddressUtils.ipToInt(IPAddressUtils.java:64)
at org.xins.server.IPFilter.match(IPFilter.java:263)
at org.xins.server.AccessRule.isAllowed(AccessRule.java:325)
at org.xins.server.AccessRuleList.isAllowed(AccessRuleList.java:245)
at org.xins.server.API.allow(API.java:1000)
at org.xins.server.API.handleCall(API.java:1066)
at org.xins.server.Engine.invokeFunction(Engine.java:833)
at org.xins.server.Engine.delegateToCC(Engine.java:677)
at org.xins.server.Engine.doService(Engine.java:567)
at org.xins.server.Engine.service(Engine.java:444)
at org.xins.server.APIServlet.service(APIServlet.java:354)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:613)

This is withg the following envirionment:
- Tomcat 6.0.10
- Java 1.5.0
- Mac OS X 10.4.10
- XINS 2.0

Discussion

  • Ernst de Haan
    Ernst de Haan
    2007-08-10

    Logged In: YES
    user_id=11053
    Originator: YES

    Here's a new stack trace, this time generated with XINS 2.1-alpha3-dev (updated today):

    1052 ERROR Programming error detected by class org.xins.common.Utils, method logProgrammingError in class org.xins.common.Utils, method logProgrammingError. Caught unexpected org.xins.common.ProgrammingException. Exception message: "Programming error suspected in class org.xins.server.AccessRuleList, method isAllowed. Detected by class org.xins.server.API, method allow. Detail: "Malformed IP address: "0:0:0:0:0:0:0:1%0".".". Detail: (null).
    org.xins.common.text.ParseException: The string "0:0:0:0:0:0:0:1%0" is not a valid IP address.
    at org.xins.common.net.IPAddressUtils.newParseException(IPAddressUtils.java:244)
    at org.xins.common.net.IPAddressUtils.ipPartToInt(IPAddressUtils.java:145)
    at org.xins.common.net.IPAddressUtils.ipToInt(IPAddressUtils.java:65)
    at org.xins.server.IPFilter.match(IPFilter.java:263)
    at org.xins.server.AccessRule.isAllowed(AccessRule.java:348)
    at org.xins.server.AccessRuleList.isAllowed(AccessRuleList.java:248)
    at org.xins.server.API.allow(API.java:958)
    at org.xins.server.API.handleCall(API.java:1025)
    at org.xins.server.Engine.invokeFunction(Engine.java:849)
    at org.xins.server.Engine.delegateToCC(Engine.java:693)
    at org.xins.server.Engine.doService(Engine.java:583)
    at org.xins.server.Engine.service(Engine.java:460)
    at org.xins.server.APIServlet.service(APIServlet.java:216)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
    at java.lang.Thread.run(Thread.java:613)

     
  • Ernst de Haan
    Ernst de Haan
    2007-08-10

    • priority: 5 --> 2