]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: mux-spop: Properly handle parsing of split HELLO/DISCONNECT frames
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 28 Aug 2026 08:24:08 +0000 (10:24 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 28 Aug 2026 08:34:02 +0000 (10:34 +0200)
The parsing of HELLO/DISCONNECT frames did not properly handle frames split
into several packets. In that case, the frame header parsing was not
bypassed once received and consumed when waiting for the payload. So when
the frame payload was finally received, the demux tried to re-read the frame
headers, triggering this way a parsing error. It was especially an issue on
HELLO frame, because this led to reject the SPOP connexion.

Now, the HELLO/DISCONNECT frames header is only parsed onced. If the demux
must wait for the frame payload, the frame header parsing is skipped to
properly parse the frame payload.

Note it was only an issue for HELLO/DISCONNECT frames.

This patch should fix the issue #3478. It must be backported as far as 3.2.

src/mux_spop.c

index c8551b7acfb40c7d28617ef0af7a14ebcea2958b..b2cebc19d50b48d1a1c939a6ff45913450bd6ae4 100644 (file)
@@ -2066,7 +2066,7 @@ static void spop_process_demux(struct spop_conn *spop_conn)
                        TRACE_STATE("waiting AGENT HELLO frame to be sent", SPOP_EV_RX_FRAME|SPOP_EV_RX_FHDR|SPOP_EV_RX_HELLO, spop_conn->conn);
                        goto out;
                }
-               else { /* AGENT_HELLO OR CLOSING */
+               else if (spop_conn->dsi == -1) { /* AGENT_HELLO OR CLOSING */
                        /* ensure that what is pending is a valid AGENT HELLO/DISCONNECT frame. */
                        TRACE_STATE("receiving AGENT HELLO/DISCONNECT frame header", SPOP_EV_RX_FRAME|SPOP_EV_RX_FHDR, spop_conn->conn);
                        if (!spop_get_frame_hdr(&spop_conn->dbuf, &hdr)) {