]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: proxy: only adjust the backend's bind-process when already set
authorWilly Tarreau <w@1wt.eu>
Fri, 9 May 2014 11:54:22 +0000 (13:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 May 2014 17:16:26 +0000 (19:16 +0200)
By default, a proxy's bind_proc is zero, meaning "bind to all processes".
It's only when not zero that its process list is restricted. So we don't
want the frontends to enforce the value on the backends when the backends
are still set to zero.

src/cfgparse.c

index 90825c0679f5e62d1f5f176233799d7150077485..7f11bf8842268aff557979ea1a2906b2da426fc6 100644 (file)
@@ -5948,8 +5948,9 @@ int check_config_validity()
                                /* we force the backend to be present on at least all of
                                 * the frontend's processes.
                                 */
-                               target->bind_proc = curproxy->bind_proc ?
-                                       (target->bind_proc | curproxy->bind_proc) : 0;
+                               if (target->bind_proc)
+                                       target->bind_proc = curproxy->bind_proc ?
+                                               (target->bind_proc | curproxy->bind_proc) : 0;
 
                                /* Emit a warning if this proxy also has some servers */
                                if (curproxy->srv) {
@@ -5985,8 +5986,9 @@ int check_config_validity()
                                        /* we force the backend to be present on at least all of
                                         * the frontend's processes.
                                         */
-                                       target->bind_proc = curproxy->bind_proc ?
-                                               (target->bind_proc | curproxy->bind_proc) : 0;
+                                       if (target->bind_proc)
+                                               target->bind_proc = curproxy->bind_proc ?
+                                                       (target->bind_proc | curproxy->bind_proc) : 0;
                                }
                        }
                }
@@ -6038,8 +6040,9 @@ int check_config_validity()
                                /* we force the backend to be present on at least all of
                                 * the frontend's processes.
                                 */
-                               target->bind_proc = curproxy->bind_proc ?
-                                       (target->bind_proc | curproxy->bind_proc) : 0;
+                               if (target->bind_proc)
+                                       target->bind_proc = curproxy->bind_proc ?
+                                               (target->bind_proc | curproxy->bind_proc) : 0;
                        }
                }