You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Mladen Turk <mt...@apache.org> on 2006/11/07 11:03:46 UTC

Making connector defaault address as 0.0.0.0

Hi,

With Native connector if the OS supports IPV6 the
default address (null) is translated to "::", thus
it only listens to the IPV6 addresses. In case the
OS doesn't support IPV6 (hardly to be found nowadays), the
null address is equivalent to the address="0.0.0.0".
The same is for any Java connector because default is IPV4.

I would like to make default address as "0.0.0.0" instead
passing null to the Connector. Well at least to the APR
connectors, so they behave like Java one.

Anyhow, is there any reason that I'm missing that would
prevent us to apply the:
If address property for the connector is undefined
    set it to the "0.0.0.0"

I personally see no reason how address=null is
different for address="0.0.0.0"

Comments?

Regards,
Mladen.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Making connector defaault address as 0.0.0.0

Posted by Mladen Turk <mt...@apache.org>.
Remy Maucherat wrote:
>>
>> Comments?
> 
> As you say, 0.0.0.0 is ipv4 so it looks like a bad default value to me, 
> while null means whatever the connector wants. Internally, it's up to 
> the native layer to figure it out, I think.
> 

Sure, but the fact is that Java connectors will always
use IPV4. APR connectors will use the Native generic address,
so they may vary from "0.0.0.0" to "::" depending on the
IPV6 support in the APR.

The solution is either to provide "0.0.0.0" as default which
is BTW what Java connector will always evaluate to, or just
for APR Connectors, and only when the address is not specified.

Regards,
Mladen.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Making connector defaault address as 0.0.0.0

Posted by Remy Maucherat <re...@apache.org>.
Mladen Turk wrote:
> Hi,
> 
> With Native connector if the OS supports IPV6 the
> default address (null) is translated to "::", thus
> it only listens to the IPV6 addresses. In case the
> OS doesn't support IPV6 (hardly to be found nowadays), the
> null address is equivalent to the address="0.0.0.0".
> The same is for any Java connector because default is IPV4.
> 
> I would like to make default address as "0.0.0.0" instead
> passing null to the Connector. Well at least to the APR
> connectors, so they behave like Java one.
> 
> Anyhow, is there any reason that I'm missing that would
> prevent us to apply the:
> If address property for the connector is undefined
>    set it to the "0.0.0.0"
> 
> I personally see no reason how address=null is
> different for address="0.0.0.0"
> 
> Comments?

As you say, 0.0.0.0 is ipv4 so it looks like a bad default value to me, 
while null means whatever the connector wants. Internally, it's up to 
the native layer to figure it out, I think.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Making connector defaault address as 0.0.0.0

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Mladen Turk wrote:
> Markus Schönhaber wrote:
> > Mladen Turk wrote:
> >
> > BTW: why is this situation special wrt the native connector?
>
> Right, but that's not the case for all supported OS-es.
> Windows for sure (and Solaris I think) will refuse
> 127.0.0.1 when the address="::"

Do I understand that correctly? What you're basically saying is: someone 
enables IPv6 on his machine, Tomcat listens on all IPv6 addresses but for 
some limitation of some OS[1] isn't accessible via IPv4 anymore. The solution 
you propse is to make sure that on *all* OSes (limitations in this regard or 
not) Tomcat is not accessible via IPv6.
I don't consider that a good idea. Therfore, again, my plea: if you really 
make this change, do it in a way so that this can easily be undone.

Why not simply document the fact that on an OS with these limitations 
additional measures have to be taken - like setting the address property of 
the Connector or creating an Ipv4->IPv6 redirection - if IPv4 access to 
Tomcat is (also) required?

Regards
  mks

[1] Maybe even on Windows there's some equivalent to Linux'
sysctl net.ipv6.bindv6only=0
or BSD's
sysctl -w net.inet6.ip6.v6only=0

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Making connector defaault address as 0.0.0.0

Posted by Mladen Turk <mt...@apache.org>.
Markus Schönhaber wrote:
> Mladen Turk wrote:
> 
> BTW: why is this situation special wrt the native connector?
>

Right, but that's not the case for all supported OS-es.
Windows for sure (and Solaris I think) will refuse
127.0.0.1 when the address="::"

Regards,
Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Making connector defaault address as 0.0.0.0

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Mladen Turk wrote:
> With Native connector if the OS supports IPV6 the
> default address (null) is translated to "::", thus
> it only listens to the IPV6 addresses. In case the
> OS doesn't support IPV6 (hardly to be found nowadays), the
> null address is equivalent to the address="0.0.0.0".
> The same is for any Java connector because default is IPV4.

I'm not sure I understand the problem. If you say something like
tcp        0      0 :::8080                 :::*                    LISTEN      
4338/java
means that no IPv4-only host is able to connect, this is not the case - at 
least not on my Linux machine where the above netstat-snippet comes from. I 
can connect to the Tomcat on this Linux box from an IPv4-only XP machine 
using the Linux' IPv4 address without any problems.

BTW: why is this situation special wrt the native connector?

> I would like to make default address as "0.0.0.0" instead
> passing null to the Connector. Well at least to the APR
> connectors, so they behave like Java one.
>
> Anyhow, is there any reason that I'm missing that would
> prevent us to apply the:
> If address property for the connector is undefined
>     set it to the "0.0.0.0"
>
> I personally see no reason how address=null is
> different for address="0.0.0.0"
>
> Comments?

If you really make such a change, please do it in a way that allows me to 
easily revert it. Thanks.

Regards
  mks

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org