]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: server: fix QUIC on server-template
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 28 Jul 2026 16:52:26 +0000 (18:52 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 29 Jul 2026 13:21:35 +0000 (15:21 +0200)
For QUIC backend side support, server xprt has to be set to XPRT_QUIC
when a quic4/6 address is parsed.

Prior to this patch, this was performed in _srv_parse_init(). However
this is not functional with server-template as this function is not
called for the duplicated entries. Xprt field was not updated, which
prevented any communication on these servers.

To properly initialize a QUIC server, uses the same method as SSL.
Server xprt is now set later during ssl_sock_prepare_srv_ctx(). This
callback is invoked through XPRT prepare_srv during proxy_finalize(),
called for any servers with SSL or QUIC settings.

This must be backported up to 3.3.

src/server.c
src/ssl_sock.c

index f4d3eb04ee1eb38b8a85c076716ce10d48bff161..1f328a887736d940b81ac59a8ff5524a401b086e 100644 (file)
@@ -3778,10 +3778,6 @@ static int _srv_parse_init(struct server **srv, char **args, int *cur_arg,
                                err_code |= ERR_ALERT | ERR_FATAL;
                                goto out;
                        }
-
-                       mark_tainted(TAINTED_CONFIG_EXP_KW_DECLARED);
-                       newsrv->xprt = xprt_get(XPRT_QUIC);
-                       quic_transport_params_init(&newsrv->quic_params, 0);
                }
 #else
                if (srv_is_quic(newsrv)) {
index c1bf5740087132dcb3a334a47f8ed55f2014d8a0..0013905a79eecc354f5a022188418a675bba04a0 100644 (file)
@@ -5143,9 +5143,17 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
                }
        }
 
-       /* The QUIC server xprt has already been set. */
-       if (srv->use_ssl == 1 && !srv_is_quic(srv))
-               srv->xprt = &ssl_sock;
+       if (srv->use_ssl == 1) {
+#ifdef USE_QUIC
+               if (srv_is_quic(srv)) {
+                       mark_tainted(TAINTED_CONFIG_EXP_KW_DECLARED);
+                       srv->xprt = xprt_get(XPRT_QUIC);
+                       quic_transport_params_init(&srv->quic_params, 0);
+               }
+               else
+#endif
+                       srv->xprt = &ssl_sock;
+       }
 
        if (srv->ssl_ctx.client_crt) {
                const int create_if_none = srv->flags & SRV_F_DYNAMIC ? 0 : 1;