]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: check: fix dst address when reusing a connection
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 3 Sep 2025 13:00:12 +0000 (15:00 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 3 Sep 2025 14:58:14 +0000 (16:58 +0200)
commit9410b2ab979306a9cee687ebbae1894ad951ad87
treeccbac004836e46c317c0369d66b33c903204fbba
parent6d3c3c78719cdd2bd0b271c2ef25b53e47e2d8d2
BUG/MINOR: check: fix dst address when reusing a connection

The keyword check-reuse-pool allows to reuse an idle connection to
perform a health check instead of opening a new one. It is implemented
similarly to HTTP transfer reuse : a hash is calculated with a subset of
properties to lookup a connection with the same characteristics.

One of these properties is the destination address. Initially it was
always set to NULL prior to reuse check, as this is necessary to match
connections on a reverse-HTTP server. However, this prevents reuse on
other servers with a proper address configured. Indeed, in this case
destination address is always used as key for connections inserted in
idle pool.

This patch fixes this by properly setting destination address for check
reuse. By default, it reuses the address from the server. The only
exception is if the server is using reverse-HTTP, in which case address
remains NULL.

A new test is also performed prior to try check reuse to ensure this is
not performed on a transparent server. Indeed, in this case server
address would be unset. Anyway, check cannot reuse a connection in this
case so this is OK. Note that this does not prevent to continue check
with a newly connection with a NULL address : this should be handled
more properly in another patch.

This must be backported up to 3.2.
src/tcpcheck.c