From: Willy Tarreau Date: Tue, 18 Sep 2012 18:52:35 +0000 (+0200) Subject: MINOR: config: set the bind_conf entry on listeners created from a "listen" line. X-Git-Tag: v1.5-dev13~277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81a8117b41586f07c43ad70cb5ca17532fdcfa7f;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 08c88d4fdc..d2f0dcf72d 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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++; }