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.
This commit is contained in:
Willy Tarreau 2026-06-02 18:46:01 +02:00
parent c24db7c76a
commit 777ea8b185

View file

@ -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 " <opts> : append options to QUIC \"bind\" lines\n"
#endif
" --" TCP_BIND_LONG_OPT " <opts> : 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