]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: peers: don't lose the peer's version when the hello is fragmented
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 22 Oct 2026 09:34:58 +0000 (11:34 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Mon, 26 Oct 2026 10:39:41 +0000 (11:39 +0100)
commit0ffabaf2c3aba24695b19eee102b448831d9f322
tree73fb7d67fc8ce8ea2af0cb5c6c4758f593053d05
parent6cad2b631bad8217fd5ad53fd48407465af54733
BUG/MINOR: peers: don't lose the peer's version when the hello is fragmented

The peers applet parses the protocol version from the first line of the
hello message in the GETVERSION state. However, maj_ver and min_ver are
local variables which are reset on each pass through the handler's state
machine.

If the host or peer line is not available yet, the handler returns and
resumes later in GETHOST or GETPEER, with the version lost. As a result,
PEER_F_DWNGRD is not updated and retains its previous value. A peer
announcing protocol version 2.0 may then receive timed updates it does not
support, while a 2.1 peer may receive updates without expiration.

Preserve the minor version in appctx->st1 until the peer is identified,
then use it to set or clear PEER_F_DWNGRD and reset st1. This field is
otherwise only used for error status codes, which error paths overwrite
before entering EXIT.

Since GETPEER can only be reached after a valid version has been parsed,
there is no need for an unknown-version sentinel. Remove the now unused
initialization of maj_ver and min_ver.

This has been there since 1.7 with commit 523cc9e85 ("MEDIUM: peers: Fix a
peer stick-tables synchronization issue."). This fix should be backported
to all stable versions.
src/peers.c