]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-spop: Handle CLOSING state and wait for AGENT DISCONNECT frame
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 28 Apr 2025 06:08:06 +0000 (08:08 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 30 Apr 2025 12:44:42 +0000 (14:44 +0200)
commit53c3046898633e56f74f7f05fb38cabeea1c87a1
tree8501fa293d7d8069c72263d6380f92fc11b5a3f0
parentfd7ebf117bdefdcfbd1c30a079585867eb22a57d
BUG/MEDIUM: mux-spop: Handle CLOSING state and wait for AGENT DISCONNECT frame

In the SPOE specification, when an error occurred on the SPOP connection,
HAProxy must send a DISCONNECT frame and wait for the agent DISCONNECT frame
in return before trully closing the connection.

However, this part was not properly handled by the SPOP multiplexer. In this
case, the SPOP connection should be in the CLOSING state. But this state was
not used at all. Depending on when the error was encountered, the connection
could be closed immediately, without sending any DISCONNECT frame. It was
the case when an early error was detected during the AGENT-HELLO frame
parsing. Or it could be moved from ERROR to FRAME_H state, as if no error
were detected. This case was less dramatic than it seemed because some flags
were also set to prevent any problem. But it was not obvious.

So now, the SPOP connection is properly switch to CLOSING state when an
DISCONNECT is sent to the agent to be able to wait for its DISCONNECT in
reply. spop_process_demux() was updated to parse frames in that state and
some validity checks was added.

This patch must be backport to 3.1.
src/mux_spop.c