fastd: disable link-time optimization to fix build with current toolchain
[feed/packages.git] / net / haproxy / patches / 0017-BUG-MINOR-config-don-t-propagate-process-binding-on-.patch
1 From b3228c83e320ad168f5b3e6884e771530a68a449 Mon Sep 17 00:00:00 2001
2 From: Willy Tarreau <w@1wt.eu>
3 Date: Wed, 1 Oct 2014 20:50:17 +0200
4 Subject: [PATCH 17/20] BUG/MINOR: config: don't propagate process binding on
5 fatal errors.
6
7 propagate_processes() must not be called with unresolved proxies, but
8 nothing prevents it from being called in check_config_validity(). The
9 resulting effect is that an unresolved proxy can cause a recursion
10 loop if called in such a situation, ending with a segfault after the
11 fatal error report. There's no side effect beyond this.
12
13 This patch refrains from calling the function when any error was met.
14
15 This bug also affects 1.5, it should be backported.
16 (cherry picked from commit acbe8ab38a638a076f8cf9fe2635db0e729d6a1f)
17 ---
18 src/cfgparse.c | 12 ++++++++----
19 1 file changed, 8 insertions(+), 4 deletions(-)
20
21 diff --git a/src/cfgparse.c b/src/cfgparse.c
22 index f723a3a..6e962c8 100644
23 --- a/src/cfgparse.c
24 +++ b/src/cfgparse.c
25 @@ -7112,10 +7112,14 @@ out_uri_auth_compat:
26 global.stats_fe->bind_proc = ~0UL;
27 }
28
29 - /* propagate bindings from frontends to backends */
30 - for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
31 - if (curproxy->cap & PR_CAP_FE)
32 - propagate_processes(curproxy, NULL);
33 + /* propagate bindings from frontends to backends. Don't do it if there
34 + * are any fatal errors as we must not call it with unresolved proxies.
35 + */
36 + if (!cfgerr) {
37 + for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
38 + if (curproxy->cap & PR_CAP_FE)
39 + propagate_processes(curproxy, NULL);
40 + }
41 }
42
43 /* Bind each unbound backend to all processes when not specified. */
44 --
45 2.0.4
46