-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I've had a go at tracking this down, and started by adding some  
debugging statements to check the contents of the apr_socket_t  
variables...
For IPV6 the "remote protocol address length", that is sock- 
 >local_addr->addr_str_len should be 46, and for ipv4 it should be 16...

[Sun Sep 16 17:53:46 2007] [warn] (peruser: pid=17932 uid=65534  
child=1) process_socket(): in process_socket - local protocol is 46  
remote 46
[Sun Sep 16 17:53:46 2007] [warn] (peruser: pid=17932 uid=65534  
child=1) pass_request(): in pass_request - local protocol is 46  
remote 46
[Sun Sep 16 17:53:46 2007] [warn] (peruser: pid=17932 uid=65534  
child=1) pass_request(): in pass_request stage 2 - local protocol is  
46 remote 46
[Sun Sep 16 17:53:47 2007] [warn] (peruser: pid=17947 uid=1009  
child=18) process_socket(): in process_socket - local protocol is 16  
remote 16

[Sun Sep 16 18:39:13 2007] [warn] (peruser: pid=17499 uid=65534  
child=1) pass_request(): in pass_request stage 2 - local protocol is  
46 remote 46
[Sun Sep 16 18:39:13 2007] [warn] (peruser: pid=17516 uid=1009  
child=19) child_main(): just accepted socket - local protocol is 16  
remote 16

So according to the output, all is well until it gets here:

status = listensocks[offset].accept_func((void *)&sock, &listensocks 
[offset], ptrans);

which seems to call receive_from_multiplexer to re-populate the sock  
structure...
it seems somewhere within this function, the information about the  
original connection is not being passed over correctly.

This is also the reason why the problem occurs when you dont manually  
specify an IPv4 address to listen on, if your kernel supports ipv6  
(as most do by default nowadays) apache will automatically listen on  
the ipv6 address [::]:80 (check your netstat output), which due to  
the design of ipv6 also enables it to listen for ipv4 connections  
(there is a kernel option to turn this off too)... this causes the  
addr_str_len to be set to 46 instead of 16, and the address will be  
in the sin6 field instead of the sin field of local_addr.
this structure is defined in apr_network_io.h

Perhaps someone who understands this code better can shed some light  
on it? Is it that somehow the receive_from_multiplexer function fails  
to copy across the sin6 field?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFG7YaIohkRgOjeIfIRAn07AJ4k9elff713V84Aidi5LpIQnfI+RgCgpJ4g
xK8vQlCFpJXd/PpxAeA4Uqc=
=5Nxz
-----END PGP SIGNATURE-----
_______________________________________________
Peruser mailing list
[email protected]
http://www.telana.com/mailman/listinfo/peruser

Reply via email to