From 777ea8b18552f811a39cf43b17c74a2368c0b149 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 2 Jun 2026 18:46:01 +0200 Subject: [PATCH] BUG/MINOR: haterm: do not try to bind QUIC when not supported When building without QUIC support (e.g. an SSL library not supporting it), we'll get errors when trying to bind to the SSL port that QUIC is not supported because the quic binding was unconditional. Let's only place it when QUIC is supported. No backport needed, this is only 3.4. --- src/haterm_init.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/haterm_init.c b/src/haterm_init.c index f63a9a42b..a78c41a07 100644 --- a/src/haterm_init.c +++ b/src/haterm_init.c @@ -28,7 +28,9 @@ static void haterm_usage(char *name) " -d : enable the traces for all http protocols\n" " -dS : disables splice() usage even when available\n" " -dZ : disable zero-copy forwarding\n" +#if defined(USE_QUIC) " --" QUIC_BIND_LONG_OPT " : append options to QUIC \"bind\" lines\n" +#endif " --" TCP_BIND_LONG_OPT " : append options to TCP \"bind\" lines\n" , name); exit(1); @@ -171,7 +173,7 @@ void haproxy_init_args(int argc, char **argv) struct hbuf fbuf = HBUF_NULL; // "frontend" section struct hbuf tbuf = HBUF_NULL; // "traces" section char *bits = NULL, *curves = NULL; - char *quic_bind_opt = NULL, *tcp_bind_opt = NULL; + char *quic_bind_opt __maybe_unused = NULL, *tcp_bind_opt = NULL; int sargc; /* saved argc */ char **sargv; /* saved argv */ @@ -203,6 +205,7 @@ void haproxy_init_args(int argc, char **argv) if (*opt == '-') { /* long options */ opt++; +#if defined(USE_QUIC) if (strcmp(opt, QUIC_BIND_LONG_OPT) == 0) { argv++; argc--; if (argc <= 0 || **argv == '-') @@ -210,7 +213,9 @@ void haproxy_init_args(int argc, char **argv) quic_bind_opt = *argv; } - else if (strcmp(opt, TCP_BIND_LONG_OPT) == 0) { + else +#endif + if (strcmp(opt, TCP_BIND_LONG_OPT) == 0) { argv++; argc--; if (argc <= 0 || **argv == '-') haterm_usage(progname); @@ -408,6 +413,7 @@ void haproxy_init_args(int argc, char **argv) tcp_bind_opt ? " " : "", tcp_bind_opt ? tcp_bind_opt : ""); +#if defined(USE_QUIC) /* QUIC binding */ hbuf_appendf(&fbuf, "\tbind %s@%s:%s shards by-thread ssl" " crt " HATERM_RSA_CERT_NAME @@ -415,6 +421,7 @@ void haproxy_init_args(int argc, char **argv) ipv6 ? "quic6" : "quic4", ip, port2, quic_bind_opt ? " " : "", quic_bind_opt ? quic_bind_opt : ""); +#endif } } else