]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: config/quic: Alert about PROXY protocol use on a QUIC listener
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Feb 2024 13:27:45 +0000 (14:27 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 1 Mar 2024 14:01:18 +0000 (15:01 +0100)
PROXY procotol is not supported on QUIC for now. Thus return an error during
configuration parsing if 'accept-proxy' option is used for a QUIC listener.

This patch should fix the issue #2186. It should be backport as far as 2.6.

src/cfgparse.c

index 17ddf8246b054638a613600351d4281f1bd55a69..4d4d12cd9a21b95dcacafb38b45a7a0509336017 100644 (file)
@@ -3969,13 +3969,21 @@ out_uri_auth_compat:
                        int mode = conn_pr_mode_to_proto_mode(curproxy->mode);
                        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 will remain NULL.
-                                */
-                               if (bind_conf->xprt && bind_conf->xprt == xprt_get(XPRT_QUIC))
+                       if (bind_conf->xprt && bind_conf->xprt == xprt_get(XPRT_QUIC)) {
+                               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 will remain NULL.
+                                        */
                                        bind_conf->mux_proto = get_mux_proto(ist("quic"));
+                               }
+                               if (bind_conf->options & BC_O_ACC_PROXY) {
+                                       ha_alert("Binding [%s:%d] for %s %s: QUIC protocol does not support PROXY protocol yet."
+                                                " 'accept-proxy' option cannot be used with a QUIC listener.\n",
+                                                bind_conf->file, bind_conf->line,
+                                                proxy_type_str(curproxy), curproxy->id);
+                                       cfgerr++;
+                               }
                        }
 
                        if (!bind_conf->mux_proto)