You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jim Jagielski <ji...@jaguNET.com> on 2006/01/27 21:27:41 UTC

AprEndpoint and IPv6

There's a bug report (37788) regarding allowing AprEndpoint
to use APR IPv6 addresses. Their patch is almost right, but
instead the value should be to use APR_UNSPEC instead
of APR_INET6 (or the current APR_INET) to allow APR
to correctly determine IP version and do a graceful
recovery... As well as handle cases where APR wasn't
built with IPv6 support.

I'd like to commit that change... comments?

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


Re: AprEndpoint and IPv6

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Jean-frederic Clere wrote:
> Jean-frederic Clere wrote:
> > Jim Jagielski wrote:
> >> There's a bug report (37788) regarding allowing AprEndpoint
> >> to use APR IPv6 addresses. Their patch is almost right, but
> >> instead the value should be to use APR_UNSPEC instead
> >> of APR_INET6 (or the current APR_INET) to allow APR
> >> to correctly determine IP version and do a graceful
> >> recovery... As well as handle cases where APR wasn't
> >> built with IPv6 support.
> >>
> >> I'd like to commit that change... comments?
> >
> > -1: It also cores on my machine.
> > +++
> > #
> > # An unexpected error has been detected by HotSpot Virtual Machine:
> > #
> > #  SIGSEGV (0xb) at pc=0xa808eb5e, pid=10005, tid=3084708160
> > #
> > # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
> > # Problematic frame:
> > # C  [libapr-1.so.0+0x19b5e]  apr_socket_bind+0x2e
> > #
> > +++
> >
> > APR_INET6 works OK with the same configuration.
>
> With the following patch:
> +++
> Index: src/network.c
> ===================================================================
> --- src/network.c       (revision 373299)
> +++ src/network.c       (working copy)
> @@ -280,7 +280,7 @@
>      GET_S_FAMILY(f, family);
>      GET_S_TYPE(t, type);
>
> -    if (family > 0) {
> +    if (family >= 0) {
>          TCN_THROW_IF_ERR(apr_socket_create(&s,
>                           f, t, protocol, p), a);
>      }
> @@ -290,7 +290,7 @@
>      a = (tcn_socket_t *)apr_pcalloc(p, sizeof(tcn_socket_t));
>      a->sock = s;
>      a->pool = p;
> -    if (family > 0)
> +    if (family >= 0)
>          a->net = &apr_socket_layer;
>      a->opaque   = s;
>      apr_pool_cleanup_register(p, (const void *)a,
> +++
> It works.
>
> Comments?

With the above patch it works for me too.

Regards
  mks

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


Re: AprEndpoint and IPv6

Posted by Jean-frederic Clere <jf...@telefonica.net>.
Jean-frederic Clere wrote:

> Jim Jagielski wrote:
>
>> There's a bug report (37788) regarding allowing AprEndpoint
>> to use APR IPv6 addresses. Their patch is almost right, but
>> instead the value should be to use APR_UNSPEC instead
>> of APR_INET6 (or the current APR_INET) to allow APR
>> to correctly determine IP version and do a graceful
>> recovery... As well as handle cases where APR wasn't
>> built with IPv6 support.
>>
>> I'd like to commit that change... comments?
>
>
> -1: It also cores on my machine.
> +++
> #
> # An unexpected error has been detected by HotSpot Virtual Machine:
> #
> #  SIGSEGV (0xb) at pc=0xa808eb5e, pid=10005, tid=3084708160
> #
> # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
> # Problematic frame:
> # C  [libapr-1.so.0+0x19b5e]  apr_socket_bind+0x2e
> #
> +++
>
> APR_INET6 works OK with the same configuration.

With the following patch:
+++
Index: src/network.c
===================================================================
--- src/network.c       (revision 373299)
+++ src/network.c       (working copy)
@@ -280,7 +280,7 @@
     GET_S_FAMILY(f, family);
     GET_S_TYPE(t, type);

-    if (family > 0) {
+    if (family >= 0) {
         TCN_THROW_IF_ERR(apr_socket_create(&s,
                          f, t, protocol, p), a);
     }
@@ -290,7 +290,7 @@
     a = (tcn_socket_t *)apr_pcalloc(p, sizeof(tcn_socket_t));
     a->sock = s;
     a->pool = p;
-    if (family > 0)
+    if (family >= 0)
         a->net = &apr_socket_layer;
     a->opaque   = s;
     apr_pool_cleanup_register(p, (const void *)a,
+++
It works.

Comments?

Cheers

Jean-Frederic

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


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


Re: AprEndpoint and IPv6

Posted by Jean-frederic Clere <jf...@telefonica.net>.
Jim Jagielski wrote:

> There's a bug report (37788) regarding allowing AprEndpoint
> to use APR IPv6 addresses. Their patch is almost right, but
> instead the value should be to use APR_UNSPEC instead
> of APR_INET6 (or the current APR_INET) to allow APR
> to correctly determine IP version and do a graceful
> recovery... As well as handle cases where APR wasn't
> built with IPv6 support.
>
> I'd like to commit that change... comments?

-1: It also cores on my machine.
+++
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xa808eb5e, pid=10005, tid=3084708160
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
# Problematic frame:
# C  [libapr-1.so.0+0x19b5e]  apr_socket_bind+0x2e
#
+++

APR_INET6 works OK with the same configuration.

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


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


Re: AprEndpoint and IPv6

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Jan 29, 2006, at 5:07 AM, Jean-frederic Clere wrote:

> Jim Jagielski wrote:
>
>> There's a bug report (37788) regarding allowing AprEndpoint
>> to use APR IPv6 addresses. Their patch is almost right, but
>> instead the value should be to use APR_UNSPEC instead
>> of APR_INET6 (or the current APR_INET) to allow APR
>> to correctly determine IP version and do a graceful
>> recovery... As well as handle cases where APR wasn't
>> built with IPv6 support.
>>
>> I'd like to commit that change... comments?
>
> Looking to src/network.c, I have noted:
> +++
>    if (family > 0) {
>        TCN_THROW_IF_ERR(apr_socket_create(&s,
>                         f, t, protocol, p), a);
>    }
> +++
> Isn't APR_UNSPEC defined to zero? - that would explain the problem  
> decribed in
> http://issues.apache.org/bugzilla/attachment.cgi?id=17525 -
>

Yep, the Hotspot output also confirms this...

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


Re: AprEndpoint and IPv6

Posted by Jean-frederic Clere <jf...@telefonica.net>.
Jim Jagielski wrote:

> There's a bug report (37788) regarding allowing AprEndpoint
> to use APR IPv6 addresses. Their patch is almost right, but
> instead the value should be to use APR_UNSPEC instead
> of APR_INET6 (or the current APR_INET) to allow APR
> to correctly determine IP version and do a graceful
> recovery... As well as handle cases where APR wasn't
> built with IPv6 support.
>
> I'd like to commit that change... comments?

Looking to src/network.c, I have noted:
+++
    if (family > 0) {
        TCN_THROW_IF_ERR(apr_socket_create(&s,
                         f, t, protocol, p), a);
    }
+++
Isn't APR_UNSPEC defined to zero? - that would explain the problem 
decribed in
http://issues.apache.org/bugzilla/attachment.cgi?id=17525 -

Cheers

Jean-Frederic

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


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


Re: AprEndpoint and IPv6

Posted by Remy Maucherat <re...@apache.org>.
Jim Jagielski wrote:
> There's a bug report (37788) regarding allowing AprEndpoint
> to use APR IPv6 addresses. Their patch is almost right, but
> instead the value should be to use APR_UNSPEC instead
> of APR_INET6 (or the current APR_INET) to allow APR
> to correctly determine IP version and do a graceful
> recovery... As well as handle cases where APR wasn't
> built with IPv6 support.
> 
> I'd like to commit that change... comments?

If it works, it's fine. I can't test this.

Rémy

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