]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: connection: fix double negation on memcmp()
authorDavid CARLIER <devnexen@gmail.com>
Thu, 24 Mar 2016 09:22:36 +0000 (09:22 +0000)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Mar 2016 10:25:46 +0000 (11:25 +0100)
Nothing harmful in here, just clarify that it applies to the whole
expression.

src/connection.c

index 6eab5e1e16f6f17e55d3368a64f8f9fa4aa4a6de..b8be0a106fdf185676c7dd7d4d61d263e9aa0269 100644 (file)
@@ -385,7 +385,7 @@ int conn_recv_proxy(struct connection *conn, int flag)
        if (trash.len < 9) /* shortest possible line */
                goto missing;
 
-       if (!memcmp(line, "TCP4 ", 5) != 0) {
+       if (memcmp(line, "TCP4 ", 5) == 0) {
                u32 src3, dst3, sport, dport;
 
                line += 5;
@@ -426,7 +426,7 @@ int conn_recv_proxy(struct connection *conn, int flag)
                ((struct sockaddr_in *)&conn->addr.to)->sin_port          = htons(dport);
                conn->flags |= CO_FL_ADDR_FROM_SET | CO_FL_ADDR_TO_SET;
        }
-       else if (!memcmp(line, "TCP6 ", 5) != 0) {
+       else if (memcmp(line, "TCP6 ", 5) == 0) {
                u32 sport, dport;
                char *src_s;
                char *dst_s, *sport_s, *dport_s;