]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: tools: fix build error with new PA_O_DEFAULT_DGRAM
authorWilly Tarreau <w@1wt.eu>
Tue, 23 Mar 2021 17:36:37 +0000 (18:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 Mar 2021 17:38:13 +0000 (18:38 +0100)
Previous commit 69ba35146 ("MINOR: tools: introduce new option
PA_O_DEFAULT_DGRAM on str2sa_range.") managed to introduce a
parenthesis imbalance that broke the build. No backport is needed.

src/tools.c

index 3f3460d3eaeb1f7aad7f0d4288d9b3ec9462f19c..98adb322668687ca2475f1d6bc6ebe88cb9c39c7 100644 (file)
@@ -910,9 +910,8 @@ struct sockaddr_storage *str2sa_range(const char *str, int *port, int *low, int
        memset(&ss, 0, sizeof(ss));
 
        /* prepare the default socket types */
-       if (((opts & (PA_O_STREAM|PA_O_DGRAM)) == PA_O_DGRAM))
-           || (((opts & (PA_O_STREAM|PA_O_DGRAM)) == (PA_O_DGRAM|PA_O_STREAM))
-               && (opts & PA_O_DEFAULT_DGRAM))
+       if ((opts & (PA_O_STREAM|PA_O_DGRAM)) == PA_O_DGRAM ||
+           ((opts & (PA_O_STREAM|PA_O_DGRAM)) == (PA_O_DGRAM|PA_O_STREAM) && (opts & PA_O_DEFAULT_DGRAM)))
                sock_type = ctrl_type = SOCK_DGRAM;
        else
                sock_type = ctrl_type = SOCK_STREAM;