httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Eggleston <...@arbor.net>
Subject [users@httpd] (22)Invalid argument: connect to listener on 0.0.0.0:443
Date Fri, 10 Apr 2009 16:43:30 GMT
Hi all,
I have a question I hope someone can help me with.

I'm running apache 2.2.6 with the pre-fork MPM on OpenBSD 4.2.
It seems to work as expected, except I get bursts of error messages in  
my www_error log:
[Fri Apr 10 13:58:54 2009] [warn] (22)Invalid argument: connect to  
listener on 0.0.0.0:443
[Fri Apr 10 13:58:55 2009] [warn] (22)Invalid argument: connect to  
listener on 0.0.0.0:443
[Fri Apr 10 13:58:56 2009] [warn] (22)Invalid argument: connect to  
listener on 0.0.0.0:443
[Fri Apr 10 13:58:57 2009] [warn] (22)Invalid argument: connect to  
listener on 0.0.0.0:443
....

Looking at the source code, this seems to be coming from  
mpm_common.c:dummy_connection()
     rv = apr_socket_connect(sock, ap_listeners->bind_addr);
     if (rv != APR_SUCCESS) {
         int log_level = APLOG_WARNING;

         if (APR_STATUS_IS_TIMEUP(rv)) {
             /* probably some server processes bailed out already and  
there
              * is nobody around to call accept and clear out the kernel
              * connection queue; usually this is not worth logging
              */
             log_level = APLOG_DEBUG;
         }

         ap_log_error(APLOG_MARK, log_level, rv, ap_server_conf,
                      "connect to listener on %pI", ap_listeners- 
 >bind_addr);
     }

Specifically, from code inspection, it looks like the call to  
connect() in apr_socket_connect() fails with errno 22 "Invalid  
argument", as the log message says. It seems apache is trying to  
connect to one of its sub-processes using the address 0.0.0.0.

Interestingly, connecting to 0.0.0.0 seems to be allowed under Linux  
and OS X, but not under OpenBSD.

OpenBSD:
$ telnet 0.0.0.0 23
Trying 0.0.0.0...
telnet: connect to address 0.0.0.0: Invalid argument
(Note, this is the same error that apache gets.)

Linux:
$ telnet 0.0.0.0 22
Trying 0.0.0.0...
Connected to 0.0.0.0.
Escape character is '^]'.

OS X:
$ telnet 0.0.0.0 22
Trying 0.0.0.0...
Connected to 0.0.0.0.
Escape character is '^]'.

Looking at the OpenBSD man page for connect, it does seem that for  
some reason they decided to disallow this:
      [EINVAL]      A TCP connection with a local broadcast, the all- 
ones or a
                    multicast address as the peer was attempted.
(I'm guessing by "local broadcast" they mean 0.0.0.0.)

Based on RFCs 3330 and 1700, OpenBSD may be doing the correct thing,  
as the RFCs seem to be saying that 0.0.0.0 can only be used as a  
source. But in this case, it seems to be getting in the way.

Can anyone provide more insight into this? I'm not really sure what  
apache is trying to do when this error is generated.

Thanks,
Joe

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message