]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] checks: report it if checks fail due to socket creation error
authorWilly Tarreau <w@1wt.eu>
Wed, 9 Mar 2011 19:38:33 +0000 (20:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 13 Mar 2011 21:12:54 +0000 (22:12 +0100)
If the check fails for a low-level socket error (eg: address family not
supportd), we currently ignore the status. We must report the error and
declare a failed health check in this case. The only real reason for this
would be when an IPv6 check is required on an IPv4-only system.

src/checks.c

index e4982ca5a00d17a457f294cad696d9aaee45090c..147a7abd67b5ada6aa8aa685b0d526e722ffe989 100644 (file)
@@ -1430,6 +1430,8 @@ struct task *process_chk(struct task *t)
                        fdinfo[fd].port_range = NULL;
                        close(fd); /* socket creation error */
                }
+               else
+                       set_server_check_status(s, HCHK_STATUS_SOCKERR, strerror(errno));
 
                if (s->result == SRV_CHK_UNKNOWN) { /* nothing done */
                        //fprintf(stderr, "process_chk: 6\n");