mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
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:
parent
a020fbd593
commit
81a8117b41
@ -1447,12 +1447,17 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
|||||||
/* parse the listener address if any */
|
/* parse the listener address if any */
|
||||||
if ((curproxy->cap & PR_CAP_FE) && *args[2]) {
|
if ((curproxy->cap & PR_CAP_FE) && *args[2]) {
|
||||||
struct listener *new, *last = curproxy->listen;
|
struct listener *new, *last = curproxy->listen;
|
||||||
|
|
||||||
if (!str2listener(args[2], curproxy, file, linenum)) {
|
if (!str2listener(args[2], curproxy, file, linenum)) {
|
||||||
err_code |= ERR_FATAL;
|
err_code |= ERR_FATAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bind_conf = bind_conf_alloc(&curproxy->conf.bind, file, linenum, args[2]);
|
||||||
|
|
||||||
new = curproxy->listen;
|
new = curproxy->listen;
|
||||||
while (new != last) {
|
while (new != last) {
|
||||||
|
new->bind_conf = bind_conf;
|
||||||
new = new->next;
|
new = new->next;
|
||||||
global.maxsock++;
|
global.maxsock++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user