[ 
https://issues.apache.org/jira/browse/AXIS2-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17912406#comment-17912406
 ] 

Christian Ortlepp commented on AXIS2-5858:
------------------------------------------

PR: https://github.com/apache/axis-axis2-java-core/pull/842

Unfortunately in many places in axis we pass around URLs as simple strings, and 
then do string processing on them. I believe that this bug here was cause by a 
simple "url.indexOf(':')" call which was supposed to find the port, but instead 
returned one of the separators of the IPv6 address. I think it is a bad idea to 
try to fix the parsing, instead I used java.net.URI to parse the url and 
extract the address. As a fallback (if the URL is not valid) I still kept the 
old code in order to keep as much compatibility as possible. Ideally I think we 
should generally not pass around URIs as strings, but this would be a much 
bigger refactor and probably introduce more bugs.

While searching for this bug I also stumbled of some code that tries to 
determine the host IP, which is also IPv4 only. I tried to make this more 
generic by using some code from another apache project which seemed quite good 
to me. That change is likely unrelated to this bug, and I'm not 100% sure that 
it could itself not introduce a new bug (for  example the new code might return 
an IPv6 address where before it only returned IPv4 addresses). Maybe one of the 
other maintainers can weigh in on whether this is worth the risk.

Note: I was unable to execute the tests but I think for reasons that are 
unrelated to this change, but we should definitely run them in CI before 
merging this.

> soap:address location's value is wrong  with IPv6
> -------------------------------------------------
>
>                 Key: AXIS2-5858
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5858
>             Project: Axis2
>          Issue Type: Bug
>    Affects Versions: 1.6.2
>            Reporter: yeqing Li
>            Assignee: Robert Lazarski
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: IPv4.PNG, IPv6.PNG
>
>   Original Estimate: 12h
>  Remaining Estimate: 12h
>
> When I access the wsdl url with IPv4,it worked well,but if with IPv6,the 
> soap:address location’s value is wrong.
> IPv6: [fe80::a9a8:18be:bb91:8787]
> Please check the attachment.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to