httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Eggleston <>
Subject [users@httpd] (22)Invalid argument: connect to listener on
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
[Fri Apr 10 13:58:55 2009] [warn] (22)Invalid argument: connect to  
listener on
[Fri Apr 10 13:58:56 2009] [warn] (22)Invalid argument: connect to  
listener on
[Fri Apr 10 13:58:57 2009] [warn] (22)Invalid argument: connect to  
listener on

Looking at the source code, this seems to be coming from  
     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  
              * 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- 

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

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

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

$ telnet 22
Connected to
Escape character is '^]'.

$ telnet 22
Connected to
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

Based on RFCs 3330 and 1700, OpenBSD may be doing the correct thing,  
as the RFCs seem to be saying that 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.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message