]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: flt-trace: Properly compute length of the first DATA block
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 11 Feb 2026 09:20:12 +0000 (10:20 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 18 Feb 2026 08:44:15 +0000 (09:44 +0100)
This bug is quite old. When the length of the first DATA block is computed,
the offset is used instead of the block length minus the offset. It is only
used with random forwarding and there is a test just after to prevent any
issue, so there is no effect.

It could be backported to all stable versions.

src/flt_trace.c

index 3703dede5cccb9fee69deacf96fbbddbde0f43ff..4605013bbd5900ab22658791df047be40ee9e761 100644 (file)
@@ -162,7 +162,7 @@ trace_get_htx_datalen(struct htx *htx, unsigned int offset, unsigned int len)
 
        blk = htxret.blk;
        if (blk && htxret.ret && htx_get_blk_type(blk) == HTX_BLK_DATA) {
-               data += htxret.ret;
+               data += htx_get_blksz(blk) - htxret.ret;
                blk = htx_get_next_blk(htx, blk);
        }
        while (blk) {