using "send-proxy" or "send-proxy-v2" option on a ring server is not
relevant nor supported. Worse, on 2.4 it causes haproxy process to
crash as reported in GH #2965.
Let's be more explicit about the fact that this keyword is not supported
under "ring" context by ignoring the option and emitting a warning message
to inform the user about that.
Ideally, we should do the same for peers and log servers. The proper way
would be to check servers options during postparsing but we currently lack
proper cross-type server postparsing hooks. This will come later and thus
will give us a chance to perform the compatibilty checks for server
options depending on proxy type. But for now let's simply fix the "ring"
case since it is the only one that's known to cause a crash.
It may be backported to all stable versions.
(cherry picked from commit
098a5e5c0b9e6821c03945295dd1350e5d834eb3)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit
975a8e8da092d0b26b61514d6973e05281441df9)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
err_code |= parse_server(file, linenum, args, cfg_sink->forward_px, NULL,
SRV_PARSE_PARSE_ADDR|SRV_PARSE_INITIAL_RESOLVE);
+
+ if (err_code & ERR_CODE)
+ goto err;
+
+ /* FIXME: ideally this check should be performed during server postparsing
+ * for all proxies where this option is unsupported, but for now we lack
+ * server postparsing rules for sinks so let's put that here
+ */
+ if (cfg_sink->forward_px->srv && cfg_sink->forward_px->srv->pp_opts) {
+ cfg_sink->forward_px->srv->pp_opts = 0;
+ ha_warning("parsing [%s:%d] : 'send-proxy*' server option is unsupported there, ignoring it\n", file, linenum);
+ err_code |= ERR_WARN;
+ }
}
else if (strcmp(args[0],"timeout") == 0) {
if (!cfg_sink || !cfg_sink->forward_px) {