]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: set the bind_conf entry on listeners created from a "listen" line.
authorWilly Tarreau <w@1wt.eu>
Tue, 18 Sep 2012 18:52:35 +0000 (20:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Sep 2012 18:56:12 +0000 (20:56 +0200)
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.

src/cfgparse.c

index 08c88d4fdcf5ec2ce64999f65e9410c57c692385..d2f0dcf72dc325989223c9c380697a4b80fdda30 100644 (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++;
                        }