You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "William A. Rowe, Jr." <wr...@apache.org> on 2002/10/27 04:52:40 UTC

Re: cvs commit: apr/network_io/win32 sockets.c

FWIW, somehow this patch breaks Win32 with APR_HAVE_IPV6.

The Apache service named  reported the following error:
>>> [Sat Oct 26 22:45:29 2002] [crit] (OS 11001)No such host is known.  : alloc_listener: failed to set up sockaddr for ::     .

No time to debug now... a dozen overdue assignments.  Just wanted
to pass on a heads up and invite folks to look at this.

Bill

>trawick     2002/10/25 10:15:37
>
>  Modified:    .        CHANGES
>               include/arch/os2 networkio.h
>               include/arch/unix networkio.h
>               include/arch/win32 networkio.h
>               network_io/os2 sockets.c
>               network_io/unix sa_common.c sockaddr.c sockets.c
>               network_io/win32 sockets.c
>  Log:
>  Fix a problem retrieving the remote socket address for sockets
>  created via apr_os_sock_put() or apr_s_sock_make()
>  
>  1.69      +7 -0      apr/network_io/unix/sa_common.c
>  
>  Index: sa_common.c
>  ===================================================================
>  RCS file: /home/cvs/apr/network_io/unix/sa_common.c,v
>  retrieving revision 1.68
>  retrieving revision 1.69
>  diff -u -r1.68 -r1.69
>  --- sa_common.c       15 Oct 2002 12:27:38 -0000      1.68
>  +++ sa_common.c       25 Oct 2002 17:15:37 -0000      1.69
>  @@ -209,6 +209,13 @@
>           *sa = sock->local_addr;
>       }
>       else if (which == APR_REMOTE) {
>  +        if (sock->remote_addr_unknown) {
>  +            apr_status_t rv = get_remote_addr(sock);
>  +
>  +            if (rv != APR_SUCCESS) {
>  +                return rv;
>  +            }
>  +        }
>           *sa = sock->remote_addr;
>       }
>       else {
>  
>  1.91      +4 -0      apr/network_io/win32/sockets.c
>  
>  Index: sockets.c
>  ===================================================================
>  RCS file: /home/cvs/apr/network_io/win32/sockets.c,v
>  retrieving revision 1.90
>  retrieving revision 1.91
>  diff -u -r1.90 -r1.91
>  --- sockets.c 22 Oct 2002 03:35:47 -0000      1.90
>  +++ sockets.c 25 Oct 2002 17:15:37 -0000      1.91
>  @@ -451,6 +451,9 @@
>           /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */
>           (*apr_sock)->remote_addr->port = ntohs((*apr_sock)->remote_addr->sa.sin.sin_port);
>       }
>  +    else {
>  +        (*apr_sock)->remote_addr_unknown = 1;
>  +    }
>           
>       apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), 
>                           socket_cleanup, apr_pool_cleanup_null);
>  @@ -471,6 +474,7 @@
>           (*sock)->disconnected = 0;
>       }
>       (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1;
>  +    (*sock)->remote_addr_unknown = 1;
>       (*sock)->socketdes = *thesock;
>       return APR_SUCCESS;
>   }


Re: cvs commit: apr/network_io/win32 sockets.c

Posted by Jeff Trawick <tr...@attglobal.net>.
"William A. Rowe, Jr." <wr...@apache.org> writes:

> Yes, however Win32 would start with IPv6 with the
> 
> Listen 80
> 
> directive last week.  Something changed this week that the default
> IP [0::0] no longer works correctly.  Named IPs were giving me trouble
> all along.

I know what you mean by "0::0", but it is really "::", and Apache
assumes that apr_sockaddr_info_get/getaddrinfo() can grok "::" (and
"0.0.0.0" too, for that matter).

My tree on Linux (2 days old?) is handling "Listen nn" fine (Apache
looks up "::" and magic happens).

Note that some older Unix variants (AIX 4.3.3 without maintenance,
Solaris 8 without maintenance, surely other platforms too) simply
didn't have getaddrinfo() working properly and IPv6 just didn't work
right for Apache+APR.  ./configure catches some bogosities and
disables IPv6 support outright ("no working getaddrinfo") when
appropriate.  So be alert to Microsoft perhaps not getting it perfect
either.

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Re: cvs commit: apr/network_io/win32 sockets.c

Posted by Jeff Trawick <tr...@attglobal.net>.
"William A. Rowe, Jr." <wr...@apache.org> writes:

> Yes, however Win32 would start with IPv6 with the
> 
> Listen 80
> 
> directive last week.  Something changed this week that the default
> IP [0::0] no longer works correctly.  Named IPs were giving me trouble
> all along.

I know what you mean by "0::0", but it is really "::", and Apache
assumes that apr_sockaddr_info_get/getaddrinfo() can grok "::" (and
"0.0.0.0" too, for that matter).

My tree on Linux (2 days old?) is handling "Listen nn" fine (Apache
looks up "::" and magic happens).

Note that some older Unix variants (AIX 4.3.3 without maintenance,
Solaris 8 without maintenance, surely other platforms too) simply
didn't have getaddrinfo() working properly and IPv6 just didn't work
right for Apache+APR.  ./configure catches some bogosities and
disables IPv6 support outright ("no working getaddrinfo") when
appropriate.  So be alert to Microsoft perhaps not getting it perfect
either.

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Re: cvs commit: apr/network_io/win32 sockets.c

Posted by "William A. Rowe, Jr." <wr...@apache.org>.
At 06:49 AM 10/27/2002, Jeff Trawick wrote:

>I don't see how any of this commit affects that path...

It may not.  There -are- problems with the IPV6 port on Win32, yet
and still...

>didn't you say almost exactly the same thing after commiting something
>to turn on IPv6 for Win32 about a week ago?

Yes, however Win32 would start with IPv6 with the

Listen 80

directive last week.  Something changed this week that the default
IP [0::0] no longer works correctly.  Named IPs were giving me trouble
all along.

Bill




Re: cvs commit: apr/network_io/win32 sockets.c

Posted by "William A. Rowe, Jr." <wr...@apache.org>.
At 06:49 AM 10/27/2002, Jeff Trawick wrote:

>I don't see how any of this commit affects that path...

It may not.  There -are- problems with the IPV6 port on Win32, yet
and still...

>didn't you say almost exactly the same thing after commiting something
>to turn on IPv6 for Win32 about a week ago?

Yes, however Win32 would start with IPv6 with the

Listen 80

directive last week.  Something changed this week that the default
IP [0::0] no longer works correctly.  Named IPs were giving me trouble
all along.

Bill




Re: cvs commit: apr/network_io/win32 sockets.c

Posted by Jeff Trawick <tr...@attglobal.net>.
"William A. Rowe, Jr." <wr...@apache.org> writes:

> FWIW, somehow this patch breaks Win32 with APR_HAVE_IPV6.
> 
> The Apache service named  reported the following error:
> >>> [Sat Oct 26 22:45:29 2002] [crit] (OS 11001)No such host is known.  : alloc_listener: failed to set up sockaddr for ::     .

I don't see how any of this commit affects that path...

didn't you say almost exactly the same thing after commiting something
to turn on IPv6 for Win32 about a week ago?

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Re: cvs commit: apr/network_io/win32 sockets.c

Posted by Jeff Trawick <tr...@attglobal.net>.
"William A. Rowe, Jr." <wr...@apache.org> writes:

> FWIW, somehow this patch breaks Win32 with APR_HAVE_IPV6.
> 
> The Apache service named  reported the following error:
> >>> [Sat Oct 26 22:45:29 2002] [crit] (OS 11001)No such host is known.  : alloc_listener: failed to set up sockaddr for ::     .

I don't see how any of this commit affects that path...

didn't you say almost exactly the same thing after commiting something
to turn on IPv6 for Win32 about a week ago?

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...