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 08c88d4..d2f0dcf 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1447,12 +1447,17 @@
/* 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++;
}