MINOR: config: set the bind_conf entry on listeners created from a "listen" line.

Otherwise we would risk a segfault when checking the config's validity
(eg: when looking for conflicts on ID assignments).

Note that the same issue exists with peers_fe and the global stats_fe. All
listeners should be reviewed and simplified to use a compatible declaration
mode.
This commit is contained in:
Willy Tarreau 2012-09-18 20:52:35 +02:00
parent a020fbd593
commit 81a8117b41

View File

@ -1447,12 +1447,17 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
/* parse the listener address if any */
if ((curproxy->cap & PR_CAP_FE) && *args[2]) {
struct listener *new, *last = curproxy->listen;
if (!str2listener(args[2], curproxy, file, linenum)) {
err_code |= ERR_FATAL;
goto out;
}
bind_conf = bind_conf_alloc(&curproxy->conf.bind, file, linenum, args[2]);
new = curproxy->listen;
while (new != last) {
new->bind_conf = bind_conf;
new = new->next;
global.maxsock++;
}