]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stconn: Move data from <kip> to <kop> during zero-copy forwarding
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 6 Jan 2026 14:36:23 +0000 (15:36 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 6 Jan 2026 14:41:50 +0000 (15:41 +0100)
The <kip> of producer was not forwarded to <kop> of consumer when zero-copy
data forwarding was tried. Because of the issue, the chunking of emitted H1
messages could be invalid.

To fix the bug, sc_ep_fwd_kip() must be called at this stage.

This fix is related to the previous one (529a8dbfb "BUG/MEDIUM: mux-h1: Take
care to update <kop> value during zero-copy forwarding"). Both are required
to fully fix the issue #3230.

This patch must be backported to 3.3.

src/stconn.c

index 1f2294fa2092c92af59413e2844a8581499aff7f..9d54dbff43c7ec41cb7957dfbb1028b54b0c8a9d 100644 (file)
@@ -1351,6 +1351,7 @@ int sc_conn_recv(struct stconn *sc)
                        flags |= CO_RFL_BUF_FLUSH;
                        goto abort_fastfwd;
                }
+               sc_ep_fwd_kip(sc, sc_opposite(sc));
                ret = conn->mux->fastfwd(sc, ic->to_forward, flags);
                if (ret < 0)
                        goto abort_fastfwd;
@@ -2033,6 +2034,7 @@ int sc_applet_recv(struct stconn *sc)
                        flags |= CO_RFL_BUF_FLUSH;
                        goto abort_fastfwd;
                }
+               sc_ep_fwd_kip(sc, sc_opposite(sc));
                ret = appctx_fastfwd(sc, ic->to_forward, flags);
                if (ret < 0)
                        goto abort_fastfwd;