]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: tcpchecks: fix the connect() flags regarding delayed ack
authorWilly Tarreau <w@1wt.eu>
Fri, 24 Jan 2020 16:52:37 +0000 (17:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 Jan 2020 16:52:37 +0000 (17:52 +0100)
In issue #465, we see that Coverity detected dead code in checks.c
which is in fact a missing parenthesis to build the connect() flags
consecutive to the API change in commit fdcb007ad8 ("MEDIUM: proto:
Change the prototype of the connect() method.").

The impact should be imperceptible as in the best case it may have
resulted in a missed optimization trying to save a syscall or to merge
outgoing packets.

It may be backported as far as 2.0 though it's not critical.

src/checks.c

index 5f1cec92654c90c93b4487b13c297e59cb93ba5e..3a74996cf55ae47b85db9e2c0f7375515c48e995 100644 (file)
@@ -2945,7 +2945,7 @@ static int tcpcheck_main(struct check *check)
                        ret = SF_ERR_INTERNAL;
                        if (proto && proto->connect)
                                ret = proto->connect(conn,
-                                                    CONNECT_HAS_DATA /* I/O polling is always needed */ | (next && next->action == TCPCHK_ACT_EXPECT) ? 0 : CONNECT_DELACK_ALWAYS);
+                                                    CONNECT_HAS_DATA /* I/O polling is always needed */ | ((next && next->action == TCPCHK_ACT_EXPECT) ? 0 : CONNECT_DELACK_ALWAYS));
                        if (conn_ctrl_ready(conn) &&
                                check->current_step->conn_opts & TCPCHK_OPT_SEND_PROXY) {
                                conn->send_proxy_ofs = 1;