]> git.kaiwu.me - haproxy.git/commit
REGTESTS: tcp-rules: test the set-src, set-dst and port rewriting actions
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2026 20:37:13 +0000 (20:37 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:55:57 +0000 (16:55 +0200)
commitf32c2279e5a53691bb4dff26405204c7a1a4fad3
tree5bd513774bf3f7973597d92507f6ea6138521abb
parentc0d0464cc1ffff55c25487bb5651c71058a7a6f9
REGTESTS: tcp-rules: test the set-src, set-dst and port rewriting actions

set-src-port and set-dst-port had no coverage at all, and set-src and
set-dst were only used incidentally by other tests.

The test applies them from the "tcp-request connection", "tcp-request
session", "tcp-request content" and "http-request" rule sets and checks
the documented behaviors: set-src and set-dst preserve the port while
set-src-port and set-dst-port preserve the address, and a later rule set
overrides what an earlier one did.

It also shows that a rewrite performed from a "tcp-request connection"
rule alters the connection itself, so that fc_src and fc_dst report the
new values, while a rewrite performed at the session level leaves them
untouched.
reg-tests/tcp-rules/set_src_dst.vtc [new file with mode: 0644]