From 47915010115b9524f1392a18dd19c290a9d48217 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 5 Mar 2026 09:58:59 +0100 Subject: [PATCH] BUG/MINOR: sample: Fix sample to retrieve the number of bytes received and sent There was an issue in the if/else statement in smp_fetch_bytes() function. When req.bytes_in or req.bytes_out was requested, res.bytes_in was always returned. It is now fixed. This patch must be backported to 3.3. --- src/sample.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sample.c b/src/sample.c index 7e3d195dc..f8150eaa5 100644 --- a/src/sample.c +++ b/src/sample.c @@ -5543,7 +5543,7 @@ static int smp_fetch_bytes(const struct arg *args, struct sample *smp, const cha if (kw[2] == 'q') /* req.bytes_in or req.bytes_out */ smp->data.u.sint = (kw[10] == 'i') ? logs->req_in : logs->req_out; - if (kw[2] == 's') /* res.bytes_in or res.bytes_out */ + else if (kw[2] == 's') /* res.bytes_in or res.bytes_out */ smp->data.u.sint = (kw[10] == 'i') ? logs->res_in : logs->res_out; else /* bytes_in or bytes_out */ smp->data.u.sint = (kw[6] == 'i') ? logs->req_in : logs->res_in;