BUG/MAJOR: log-forward: Fix ssl layer not initialized on bind even if configured

Since commit 2071a99df ("MINOR: listener/ssl: set the SSL xprt layer only
once the whole config is known") the xprt is initialized for ssl directly
from a generic funtion used to parse bind args.

But the 'bind' lines from 'log-forward' sections were forgotten in commit
55f0f7bb5 ("MINOR: config: use the new bind_parse_args_list() to parse a
"bind" line").

This patch re-works 'log-forward' section parsing to use the generic
function to parse bind args and fix the issue.

Since the generic way to parse was introduced in 2.6, this patch
should be backported as far as this version.
This commit is contained in:
Emeric Brun 2022-08-19 15:16:26 +02:00 committed by Willy Tarreau
parent 3b68b60261
commit a8942cd9c4

View File

@ -3790,8 +3790,8 @@ int cfg_parse_log_forward(const char *file, int linenum, char **args, int kwm)
else if (strcmp(args[0], "bind") == 0) {
int cur_arg;
struct bind_conf *bind_conf;
struct bind_kw *kw;
struct listener *l;
int ret;
cur_arg = 1;
@ -3824,32 +3824,9 @@ int cfg_parse_log_forward(const char *file, int linenum, char **args, int kwm)
}
cur_arg++;
while (*args[cur_arg] && (kw = bind_find_kw(args[cur_arg]))) {
int ret;
ret = kw->parse(args, cur_arg, cfg_log_forward, bind_conf, &errmsg);
err_code |= ret;
if (ret) {
if (errmsg && *errmsg) {
indent_msg(&errmsg, 2);
ha_alert("parsing [%s:%d] : %s\n", file, linenum, errmsg);
}
else
ha_alert("parsing [%s:%d]: error encountered while processing '%s'\n",
file, linenum, args[cur_arg]);
if (ret & ERR_FATAL)
goto out;
}
cur_arg += 1 + kw->skip;
}
if (*args[cur_arg] != 0) {
const char *best = bind_find_best_kw(args[cur_arg]);
if (best)
ha_alert("parsing [%s:%d] : unknown keyword '%s' in '%s' section; did you mean '%s' maybe ?\n",
file, linenum, args[cur_arg], cursection, best);
else
ha_alert("parsing [%s:%d] : unknown keyword '%s' in '%s' section.\n",
file, linenum, args[cur_arg], cursection);
ret = bind_parse_args_list(bind_conf, args, cur_arg, cursection, file, linenum);
err_code |= ret;
if (ret != 0) {
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}