tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: connect to 0.0.0.0 vs ::



On 13 Feb, 2015, at 08:37 , Manuel Bouyer <bouyer%antioche.eu.org@localhost> wrote:
> After more analisis of the apache code, it turns out the master
> connects to its own listeing socket as a way to wake up one of its
> childs (this is dummy_connection() in mpm_common.c, called from
> ap_mpm_pod_signal() and ap_mpm_pod_killpg()). 
> 
> We have a different behavior for ipv4 and ipv6:
> antioche:/tmp#telnet :: 80
> Trying ::...
> telnet: Unable to connect to remote host: Network is unreachable
> antioche:/tmp#telnet 0.0.0.0 80
> Trying 0.0.0.0...
> Connected to 0.0.0.0.
> Escape character is '^]'.
> 
> and this cause apache to fail to wake its childs (and eventually fill up the
> pipe, causing the problem I'm seeing now). Is it expected behavior ?
> On a linux system, both 0.0.0.0 and :: connects to localhost if
> a socket has been open on these addresses.

I wouldn't have expected this to work for either protocol.  The only
standard use of 0.0.0.0 and :: is as a source address, never a
destination (though standards for on-the-wire behaviour don't
necessarily dictate what goes on inside a host), while 127.0.0.1
and ::1 are explicitly meant to be used for this so I don't quite
get why it would want to use something else.  I'm struggling to
think of a problem that allowing this behaviour would solve.

Is this a linux-ism and, if so, can you tell what it actually does
with the address?  In particular, if you open a connection to 0.0.0.0
and then look for the connection in netstat output does it show a
connection to 0.0.0.0 or does it translate the address to a "real"
local address before connecting?

It would be nice to know if this use actually needs to be supported
now, and if so how, since if I had noticed this working I think I
would have taken it to be a bug and fixed it.

Dennis Ferguson


Home | Main Index | Thread Index | Old Index