From 626cfd85aa0afac15a4855b6344c5b6024967ce4 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Mon, 7 Jul 2025 11:20:28 +0200 Subject: [PATCH] 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 --- src/cfgparse.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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; -- 2.47.2