Re: svn commit: r1291760 - in /tomcat/native/branches/1.1.x: native/src/address.c xdocs/miscellaneous/changelog.xml

2012-02-21 Thread Konstantin Kolinko
2012/2/21 Mladen Turk :
> On 02/21/2012 03:06 PM, Konstantin Kolinko wrote:
>>
>> 2012/2/21:
>>
>>> @@ -58,6 +70,13 @@ TCN_IMPLEMENT_CALL(jlong, Address, info)
>>>             sl = sa;
>>>         }
>>>     }
>>> +    if (sp) {
>>> +        /* Set the provided scope id
>>> +         * APR lack the api for setting this directly so lets presume
>>> +         * the sin6_scope_id is present everywhere
>>> +         */
>>> +        sl->sa.sin6.sin6_scope_id = scope_id;
>>
>>
>> Maybe guard the above with #if APR_HAVE_IPV6 , like the first code
>> fragment in this patch?
>
>
> Check the full code not just patch. It is inside APR_HAVE_IPV6
>

Oh, yes. Indeed.

Best regards,
Konstantin Kolinko

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



Re: svn commit: r1291760 - in /tomcat/native/branches/1.1.x: native/src/address.c xdocs/miscellaneous/changelog.xml

2012-02-21 Thread Mladen Turk

On 02/21/2012 03:06 PM, Konstantin Kolinko wrote:

2012/2/21:

I wonder when this change will be ported to native/trunk. (Just
wondering. No real interest though).



We currently have only 1.x release which is from this branch.
Trunk will be 2.x and will require apr-2.x
I plan to add support for scope_id directly inside APR so trunk
will have different code.


Regards
--
^TM

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



Re: svn commit: r1291760 - in /tomcat/native/branches/1.1.x: native/src/address.c xdocs/miscellaneous/changelog.xml

2012-02-21 Thread Mladen Turk

On 02/21/2012 03:06 PM, Konstantin Kolinko wrote:

2012/2/21:

@@ -58,6 +70,13 @@ TCN_IMPLEMENT_CALL(jlong, Address, info)
 sl = sa;
 }
 }
+if (sp) {
+/* Set the provided scope id
+ * APR lack the api for setting this directly so lets presume
+ * the sin6_scope_id is present everywhere
+ */
+sl->sa.sin6.sin6_scope_id = scope_id;


Maybe guard the above with #if APR_HAVE_IPV6 , like the first code
fragment in this patch?


Check the full code not just patch. It is inside APR_HAVE_IPV6


Regards
--
^TM

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



Re: svn commit: r1291760 - in /tomcat/native/branches/1.1.x: native/src/address.c xdocs/miscellaneous/changelog.xml

2012-02-21 Thread Konstantin Kolinko
2012/2/21  :
> Author: mturk
> Date: Tue Feb 21 13:15:42 2012
> New Revision: 1291760
>
> URL: http://svn.apache.org/viewvc?rev=1291760&view=rev
> Log:
> Fix BZ52717 by allowing to have %scope_id as address suffix for local-link 
> IPv6 addresses
>
> Modified:
>    tomcat/native/branches/1.1.x/native/src/address.c
>    tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml
>
> Modified: tomcat/native/branches/1.1.x/native/src/address.c
> URL: 
> http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/src/address.c?rev=1291760&r1=1291759&r2=1291760&view=diff
> ==
> --- tomcat/native/branches/1.1.x/native/src/address.c (original)
> +++ tomcat/native/branches/1.1.x/native/src/address.c Tue Feb 21 13:15:42 2012
> @@ -29,6 +29,8 @@ TCN_IMPLEMENT_CALL(jlong, Address, info)
>  {
>     apr_pool_t *p = J2P(pool, apr_pool_t *);
>     TCN_ALLOC_CSTRING(hostname);
> +    char *sp = NULL;
> +    int   scope_id = 0;
>     apr_sockaddr_t *sa = NULL;
>     apr_sockaddr_t *sl = NULL;
>     apr_int32_t f;
> @@ -36,6 +38,16 @@ TCN_IMPLEMENT_CALL(jlong, Address, info)
>
>     UNREFERENCED(o);
>     GET_S_FAMILY(f, family);
> +#if APR_HAVE_IPV6
> +    if (hostname) {
> +        /* XXX: This only works for real scope_id's
> +         */
> +        if ((sp = strchr(J2S(hostname), '%'))) {
> +            *sp++ = '\0';
> +            scope_id = atoi(sp);
> +        }
> +    }
> +#endif
>     TCN_THROW_IF_ERR(apr_sockaddr_info_get(&sa,
>             J2S(hostname), f, (apr_port_t)port,
>             (apr_int32_t)flags, p), sa);
> @@ -58,6 +70,13 @@ TCN_IMPLEMENT_CALL(jlong, Address, info)
>             sl = sa;
>         }
>     }
> +    if (sp) {
> +        /* Set the provided scope id
> +         * APR lack the api for setting this directly so lets presume
> +         * the sin6_scope_id is present everywhere
> +         */
> +        sl->sa.sin6.sin6_scope_id = scope_id;

Maybe guard the above with #if APR_HAVE_IPV6 , like the first code
fragment in this patch?   I do not know what "sa.sin6" is and when it
is available, but it will lessen the chance of bumping into useless
compilation error here on an ip4-only system.

I wonder when this change will be ported to native/trunk. (Just
wondering. No real interest though).

> +    }
>  #endif
>
>  cleanup:
>
> Modified: tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml
> URL: 
> http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml?rev=1291760&r1=1291759&r2=1291760&view=diff
> ==
> --- tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml (original)
> +++ tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml Tue Feb 21 
> 13:15:42 2012
> @@ -38,6 +38,9 @@
>  
>  
>   
> +    
> +      52717: Set scope_id for IPv6 addresses if provided. (mturk)
> +    
>     
>       50570: Allow explicit use of FIPS mode in APR lifecycle 
> listener (native support only in this update; Java support to follow). Based 
> upon a patch from Chris Beckey. (schultz)
>     
>

Best regards,
Konstantin Kolinko

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



svn commit: r1291760 - in /tomcat/native/branches/1.1.x: native/src/address.c xdocs/miscellaneous/changelog.xml

2012-02-21 Thread mturk
Author: mturk
Date: Tue Feb 21 13:15:42 2012
New Revision: 1291760

URL: http://svn.apache.org/viewvc?rev=1291760&view=rev
Log:
Fix BZ52717 by allowing to have %scope_id as address suffix for local-link IPv6 
addresses

Modified:
tomcat/native/branches/1.1.x/native/src/address.c
tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml

Modified: tomcat/native/branches/1.1.x/native/src/address.c
URL: 
http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/src/address.c?rev=1291760&r1=1291759&r2=1291760&view=diff
==
--- tomcat/native/branches/1.1.x/native/src/address.c (original)
+++ tomcat/native/branches/1.1.x/native/src/address.c Tue Feb 21 13:15:42 2012
@@ -29,6 +29,8 @@ TCN_IMPLEMENT_CALL(jlong, Address, info)
 {
 apr_pool_t *p = J2P(pool, apr_pool_t *);
 TCN_ALLOC_CSTRING(hostname);
+char *sp = NULL;
+int   scope_id = 0;
 apr_sockaddr_t *sa = NULL;
 apr_sockaddr_t *sl = NULL;
 apr_int32_t f;
@@ -36,6 +38,16 @@ TCN_IMPLEMENT_CALL(jlong, Address, info)
 
 UNREFERENCED(o);
 GET_S_FAMILY(f, family);
+#if APR_HAVE_IPV6
+if (hostname) {
+/* XXX: This only works for real scope_id's
+ */
+if ((sp = strchr(J2S(hostname), '%'))) {
+*sp++ = '\0';
+scope_id = atoi(sp);
+}
+}
+#endif
 TCN_THROW_IF_ERR(apr_sockaddr_info_get(&sa,
 J2S(hostname), f, (apr_port_t)port,
 (apr_int32_t)flags, p), sa);
@@ -58,6 +70,13 @@ TCN_IMPLEMENT_CALL(jlong, Address, info)
 sl = sa;
 }
 }
+if (sp) {
+/* Set the provided scope id
+ * APR lack the api for setting this directly so lets presume
+ * the sin6_scope_id is present everywhere
+ */
+sl->sa.sin6.sin6_scope_id = scope_id;
+}
 #endif
 
 cleanup:

Modified: tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml?rev=1291760&r1=1291759&r2=1291760&view=diff
==
--- tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml Tue Feb 21 
13:15:42 2012
@@ -38,6 +38,9 @@
 
 
   
+
+  52717: Set scope_id for IPv6 addresses if provided. (mturk)
+
 
   50570: Allow explicit use of FIPS mode in APR lifecycle 
listener (native support only in this update; Java support to follow). Based 
upon a patch from Chris Beckey. (schultz)
 



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