From b15e9b1b291a1fa36ea3e76f47f491c9dd57f15e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 14 May 2026 22:43:17 +0000 Subject: [PATCH] BUG/MINOR: resolvers: report the expression error in the do-resolve() action parser When an expression is used for do-resolve(), an error may be reported. Unfortunately it was scratched and replaced by the do-resolve() error, leaving no chance to know exactly what was wrong. Let's report the contents of the error when available. It will indicate identifiers that are not found or invalid ranges or types being used. This can be backported to all versions. --- src/resolvers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resolvers.c b/src/resolvers.c index 463576acb..a3292ee85 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -3405,8 +3405,8 @@ enum act_parse_ret resolv_parse_do_resolve(const char **args, int *orig_arg, str ha_free(&rule->arg.resolv.varname); ha_free(&rule->arg.resolv.resolvers_id); ha_free(&rule->arg.resolv.opts); - memprintf(err, "Can't parse '%s'. Expects 'do-resolve(,[,]) '. Available options are 'ipv4' and 'ipv6'", - args[cur_arg]); + memprintf(err, "Can't parse '%s'%s%s. Expects 'do-resolve(,[,]) '. Available options are 'ipv4' and 'ipv6'", + args[cur_arg], *err ? ": " : "", *err ? *err : ""); return ACT_RET_PRS_ERR; }