From: Willy Tarreau Date: Fri, 20 May 2022 16:07:06 +0000 (+0200) Subject: MINOR: listener: automatically select a QUIC mux with a QUIC transport X-Git-Tag: v2.6-dev11~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=730cc02c26c41be164dae9d8d0722330be5fb101;p=thirdparty%2Fhaproxy.git MINOR: listener: automatically select a QUIC mux with a QUIC transport When no mux protocol is configured on a bind line with "proto", and the transport layer is QUIC, right now mux_h1 is being used, leading to a crash. Now when the transport layer of the bind line is already known as being QUIC, let's automatically try to configure the QUIC mux, so that users do not have to enter "proto quic" all the time while it's the only supported option. this means that the following line now works: bind quic4@:4449 ssl crt rsa+dh2048.pem alpn h3 allow-0rtt --- diff --git a/src/cfgparse.c b/src/cfgparse.c index b2426639d6..40c5a16e11 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -3753,6 +3753,15 @@ out_uri_auth_compat: int mode = (1 << (curproxy->mode == PR_MODE_HTTP)); const struct mux_proto_list *mux_ent; + if (!bind_conf->mux_proto) { + /* No protocol was specified. If we're using QUIC at the transport + * layer, we'll instantiate it as a mux as well. If QUIC is not + * compiled in, this wil remain NULL. + */ + if (bind_conf->xprt && bind_conf->xprt == xprt_get(XPRT_QUIC)) + bind_conf->mux_proto = get_mux_proto(ist("quic")); + } + if (!bind_conf->mux_proto) continue;