]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: config: authorize frontend and listen without bind.
authorEmeric Brun <ebrun@exceliance.fr>
Mon, 1 Oct 2012 15:10:30 +0000 (17:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 2 Oct 2012 06:34:39 +0000 (08:34 +0200)
This allows to easily add/remove "bind" entries to a frontend without
being forced to remove it when the last entry is temporarily removed.
While "disabled" may sometimes work in a frontend, it becomes trickier
on "listen" sections which can also hold servers and be referenced by
other frontends.

Note that a "listen" section with no "bind" is equivalent to a "backend"
section.

Configs without any listeners are still reported as invalid and refuse
to load.

src/cfgparse.c

index c6260e1e8880c23e3eed8ad45888e0f91fc2ad53..91b4b7f13f7ce55f25a31c9c7d199b55b412ea06 100644 (file)
@@ -5731,12 +5731,6 @@ int check_config_validity()
                        break;
                }
 
-               if ((curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->conf.listeners))  {
-                       Alert("config : %s '%s' has no listen address. Please either specify a valid address on the <listen> line, or use the <bind> keyword.\n",
-                             proxy_type_str(curproxy), curproxy->id);
-                       cfgerr++;
-               }
-
                if ((curproxy->cap & PR_CAP_BE) && (curproxy->mode != PR_MODE_HEALTH)) {
                        if (curproxy->lbprm.algo & BE_LB_KIND) {
                                if (curproxy->options & PR_O_TRANSP) {