]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: sample: make quic_enabled() always succeed
authorWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 08:56:37 +0000 (10:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:11:24 +0000 (16:11 +0200)
smp_fetch_quic_enabled() ends with "return smp->data.u.sint" instead of
"return 1", so it returns its boolean result as the success status of
the fetch as well. On a build without QUIC, or when the QUIC listeners
are disabled, the fetch therefore fails instead of reporting a false
boolean, and any expression using it fails to evaluate.

The issue was introduced in 2.8-dev2 with commit 33d11c464f ("MINOR:
sample: Add "quic_enabled" sample fetch") so this fix should be
backported to 2.8.

src/sample.c

index 54d8c88d78f406d407b07850ebf059753fc1e452..d110ff7b7b0ec77f13f6857d4aeea66b36475584 100644 (file)
@@ -5672,7 +5672,7 @@ static int smp_fetch_quic_enabled(const struct arg *args, struct sample *smp, co
 #else
        smp->data.u.sint = 0;
 #endif
-       return smp->data.u.sint;
+       return 1;
 }
 
 /* Timing events re{q,s}.timer.  */