From: Amaury Denoyelle Date: Mon, 7 Jul 2025 09:20:28 +0000 (+0200) Subject: MINOR: cfgparse: enforce QUIC MUX compat on server line X-Git-Tag: v3.3-dev3~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=626cfd85aa0afac15a4855b6344c5b6024967ce4;p=thirdparty%2Fhaproxy.git MINOR: cfgparse: enforce QUIC MUX compat on server line Add postparsing checks to control server line conformity regarding QUIC both on the server address and the MUX protocol. An error is reported in the following case : * proto quic is explicitely specified but server address does not specify quic4/quic6 prefix * another proto is explicitely specified but server address uses quic4/quic6 prefix --- diff --git a/src/cfgparse.c b/src/cfgparse.c index a1ea79c5c..ac505300a 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -4130,6 +4130,24 @@ out_uri_auth_compat: newsrv->id, newsrv->conf.file, newsrv->conf.line); cfgerr++; } + else { + if ((mux_ent->mux->flags & MX_FL_FRAMED) && !srv_is_quic(newsrv)) { + ha_alert("%s '%s' : MUX protocol '%.*s' is incompatible with stream transport used by server '%s' at [%s:%d].\n", + proxy_type_str(curproxy), curproxy->id, + (int)newsrv->mux_proto->token.len, + newsrv->mux_proto->token.ptr, + newsrv->id, newsrv->conf.file, newsrv->conf.line); + cfgerr++; + } + else if (!(mux_ent->mux->flags & MX_FL_FRAMED) && srv_is_quic(newsrv)) { + ha_alert("%s '%s' : MUX protocol '%.*s' is incompatible with framed transport used by server '%s' at [%s:%d].\n", + proxy_type_str(curproxy), curproxy->id, + (int)newsrv->mux_proto->token.len, + newsrv->mux_proto->token.ptr, + newsrv->id, newsrv->conf.file, newsrv->conf.line); + cfgerr++; + } + } /* update the mux */ newsrv->mux_proto = mux_ent;