BUG/MEDIUM: backend: fix reuse with set-dst/set-dst-port
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 31 Mar 2025 15:57:56 +0000 (17:57 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 15 Apr 2025 16:10:13 +0000 (18:10 +0200)
commitb2d0abb7f22debf025e313b1943cda97294b3a16
tree92e7baf84bdb656e92f60b223cd92e1c5ad9c607
parent00ada2c2806a007df77f0f4fa2aa85938ea0b19a
BUG/MEDIUM: backend: fix reuse with set-dst/set-dst-port

On backend connection reuse, a hash is calculated from various
parameters, to ensure the selected connection match the requested
parameters. Notably, destination address is one of these parameters.
However, it is only taken into account if using a transparent server
(server address 0.0.0.0).

This may cause issue where an incorrect connection is reused, which is
not targetted to the correct destination address. This may be the case
if a set-dst/set-dst-port is used with a transparent proxy (proxy option
transparent).

The fix is simple enough. Destination address is now always used as
input to the connection reuse hash.

This must be backported up to 2.6. Note that for reverse HTTP to work,
it relies on the following patch, which ensures destination address
remains NULL in this case.

  commit e94baf6ca71cb2319610baa74dbf17b9bc602b18
  BUG/MINOR: rhttp: fix incorrect dst/dst_port values

(cherry picked from commit 5fda64e87e7963fa65812e0583338191e4cc7c8b)
Signed-off-by: Aurelien DARRAGON <adarragon@haproxy.com>
src/backend.c