Option tcp-check FAILED with HA-Proxy version 1.7.8

Hello,

We have two HA-Proxy working with keepalived for load balancing between our internal servers which they have connection to outside from ports 2811 and 12811. For this reason, we need monitoring both ports to know if they are down in some moment. We use this option in our backend servers in old versions of HA-Proxy:

backend backend_name1
mode tcp
source 0.0.0.0 usesrc clientip
balance leastconn
option abortonclose
option persist
option redispatch
option tcplog
option tcp-check
tcp-check connect port 2811
tcp-check connect port 12811
stick-table type ip size 10240k expire 60m peers HAPROXYPEERSPRE
stick on src
server name_internal_server IP check weight 1 maxconn 2000 inter 3s rise 2 fall 3 on-marked-down shutdown-sessions

We had HA-Proxy versión 1.6.11 and this check works fine all time.

But when we have upgrade our HA-Proxy versión from 1.6.11 to 1.7.8 this check stop working, and we have received this error in haproxy-notice.log

HA-Proxy2 haproxy[4261]: Health check for server frontend_name1/backend_name1 failed, reason: Socket error, info: “No port available for the TCP connection”, check duration: 0ms, status: 0/2 DOWN.

HA-Proxy2 haproxy[4261]: Health check for server frontend_name1/backend_name1 failed, reason: Socket error, info: “No port available for the TCP connection”, check duration: 0ms, status: 0/2 DOWN.

HA-Proxy2 haproxy[4261]: Health check for server frontend_name1/backend_name1 failed, reason: Socket error, info: “No port available for the TCP connection”, check duration: 0ms, status: 0/2 DOWN.

HA-Proxy2 haproxy[4261]: Health check for server frontend_name1/backend_name1 failed, reason: Socket error, info: “No port available for the TCP connection”, check duration: 0ms, status: 0/2 DOWN.

We change line 1527 in checks.c (in /usr/src/haproxy-1.7.8/src/) as we have read in other topic from other web:

ORIGINAL:
if ((conn->addr.to.ss_family == AF_INET) || (conn->addr.to.ss_family == AF_INET6)) {
int i = 0;

MODIFIED:
if ((conn->addr.to.ss_family == AF_INET) || (conn->addr.to.ss_family == AF_INET6) || (check->port) {
int i = 0;

But we don’t get any result. It stills failed with the same message in haproxy-notice.log

Our question is: there are some way to configure option tcp-check without error in HA-Proxy version 1.7.8?? Any solutions of that??

If you need more information you only have to request.

Thanks

Greetings.