CLEANUP: tcpcheck: Remove a useless test on port variable
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 12 Feb 2021 15:09:13 +0000 (16:09 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 12 Feb 2021 15:42:00 +0000 (16:42 +0100)
When a connect rule is evaluated a test is performed on the "port" variable
while it is set to 0 just on the line just above. Just remove this useless
test to make ccpcheck happy.

This patch fixes the issue #1113.

src/tcpcheck.c

index 100c727..82f7b02 100644 (file)
@@ -1045,7 +1045,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_connect(struct check *check, struct tcpchec
        proto = protocol_by_family(conn->dst->ss_family);
 
        port = 0;
-       if (!port && connect->port)
+       if (connect->port)
                port = connect->port;
        if (!port && connect->port_expr) {
                struct sample *smp;