httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <>
Subject Re: Listen<port> is invalid
Date Wed, 23 Feb 2005 09:42:12 GMT
On Tue, Feb 22, 2005 at 10:52:57PM -0800, Justin Erenkrantz wrote:
> No idea why I'm suddenly hitting this, but in preparation for 2.1.3, I 
> spent another one of my patented hours searching for bugs in httpd that end 
> up being bugs in the perl-framework tests.  =(
> perl-framework generates Listen directives in the order of:
> 'Listen'
> For me, this causes errors like:
> (48)Address already in use: make_sock: could not bind to address 
> no listening sockets available, shutting down
> Unable to open logs
> On Mac OS X 10.3.8 (7.8.0 via uname -r), getaddrinfo() without AI_PASSIVE 
> can return duplicate IP addresses.  This leads to the error condition that 
> causes the failure.  And, based on my reading of the docs, I'm not sure 
> that's patently incorrect behavior on Darwin's part: that's for 
> both the localhost and the network card.

But there is no way to differentiate between any different interfaces
for the address (without doing magic), so I would say that is a resolver

"Listen<port>" should always work because there's no other way
to configure httpd to bind only to "all IPv4 addresses on the local host
with port X" (right?), which is certainly a valid and useful thing to

I think httpd should work around this: does something like the attached
work? (tested only to compile ;) Not necessarily the best place to put
this logic.

> The issue with this is that wildcard IP addresses aren't really supposed to 
> be explicit in Listen statements.  httpd has a bunch of logic for inferring 
> the right IP wildcards - trying to out-guess can lead to real badness. 
> Specifically, this mucks with APR's ability to set AI_PASSIVE - which is 
> required for use with address that we will later call bind() on - i.e. our 
> listeners.  So, Listen with an IP address should only be used for real 
> addresses.

The problem was that 2.0.x will only accept connections to IPv6
addresses with a single "Listen <port>"; but since LWP doesn't support
IPv6, that doesn't work for httpd-test.  The alternative is to start
getting complicated but with the different logic in 2.0 and 2.1 I think
it would be better to avoid this.


View raw message