From: Willy Tarreau Date: Tue, 31 May 2022 07:42:44 +0000 (+0200) Subject: BUG/MINOR: peers: detect and warn on init_addr/resolvers/check/agent-check X-Git-Tag: v2.6.0~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=824c8c5999c6df685d1cd043601a4d3ef0f950b9;p=thirdparty%2Fhaproxy.git BUG/MINOR: peers: detect and warn on init_addr/resolvers/check/agent-check Some server keywords are currently silently ignored in the peers section, which is not good because it wastes time on user-side, trying to make something work while it cannot by design. With this patch we at least report a few of them (the most common ones), which are init_addr, resolvers, check, agent-check. Others might follow. This may be backported to 2.5 to encourage some cleaning of bogus configs. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 94823114da..72512d8984 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -896,6 +896,12 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) goto out; } + if (curpeers->peers_fe->srv->init_addr_methods || curpeers->peers_fe->srv->resolvers_id || + curpeers->peers_fe->srv->do_check || curpeers->peers_fe->srv->do_agent) { + ha_warning("parsing [%s:%d] : '%s %s' : init_addr, resolvers, check and agent are ignored for peers.\n", file, linenum, args[0], args[1]); + err_code |= ERR_WARN; + } + /* If the peer address has just been parsed, let's copy it to * and initializes ->proto. */